Package pyplusplus :: Package code_creators :: Module member_variable :: Class bit_field_wrapper_t

type bit_field_wrapper_t

source code

                           object --+    
                                    |    
          code_creator.code_creator_t --+
                                        |
declaration_based.declaration_based_t --+
                                        |
                                       bit_field_wrapper_t

Creates C++ code that creates accessor for bit fields

Instance Methods
str
indent(code, size=1)
function that implements code indent algorithm.
source code
 
__init__(self, variable)
Constructor.
source code

Inherited from code_creator.code_creator_t: beautify, create, get_system_headers

Inherited from declaration_based.declaration_based_t: get_user_headers

Static Methods

Inherited from code_creator.code_creator_t: is_comment, unindent, unique_headers

Class Variables
  BF_GET_TEMPLATE = '%(type)s get_%(name)s() const {\r\n retu...
  BF_SET_TEMPLATE = 'void set_%(name)s( %(type)s new_value ){ \r...

Inherited from code_creator.code_creator_t: LINE_LENGTH, PARAM_SEPARATOR, PYPLUSPLUS_NS_NAME

Properties
  getter_full_name
  getter_type
  setter_full_name
  setter_type
  has_setter

Inherited from code_creator.code_creator_t: parent, target_configuration, top_parent, works_on_instance

Inherited from declaration_based.declaration_based_t: alias, decl_identifier, declaration, documentation

Method Details

indent(code, size=1)

source code 

function that implements code indent algorithm.

Parameters:
  • code (str) - C++ code block.
  • size (int) - The number of indentation levels that the code is shifted
Returns: str
Returns indented source code
Overrides: code_creator.code_creator_t.indent

__init__(self, variable)
(Constructor)

source code 

Constructor.

Parameters:
  • parent - Parent code creator.
Overrides: declaration_based.declaration_based_t.__init__
(inherited documentation)

Class Variable Details

BF_GET_TEMPLATE

Value:
'''%(type)s get_%(name)s() const {\r
    return %(name)s;\r
}\r
'''

BF_SET_TEMPLATE

Value:
'''void set_%(name)s( %(type)s new_value ){ \r
    %(name)s = new_value;\r
}\r
'''

Property Details

getter_full_name

Get Method:
_get_getter_full_name(self)

getter_type

Get Method:
_get_getter_type(self)

setter_full_name

Get Method:
_get_setter_full_name(self)

setter_type

Get Method:
_get_setter_type(self)

has_setter

Get Method:
_get_has_setter(self)