pyplusplus.code_creators.member_variable.member_variable_wrapper_t

Package pyplusplus :: Package code_creators :: Module member_variable :: Class member_variable_wrapper_t |

# type member_variable_wrapper_t

source code

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

Creates C++ code that creates accessor for pointer class variables

Instance Methods
str |
indent(code, size=1) function that implements code indent algorithm. | source code
__init__(self, variable) Constructor. | source code
inst_arg_type(self, has_const) | 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
| MV_GET_TEMPLATE = ``'``static %(type)s get_%(name)s(%(cls_type)s i``...``
| MV_STATIC_GET_TEMPLATE = ``'``static %(type)s get_%(name)s(){\r\n` `...``
| MV_SET_TEMPLATE = ``'``static void set_%(name)s( %(cls_type)s inst``...``
| MV_STATIC_SET_TEMPLATE = ``'``static void set_%(name)s( %(type)s n``...``
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

  ### MV_GET_TEMPLATE Value:
      '''static %(type)s get_%(name)s(%(cls_type)s inst ){\r
          return inst.%(name)s;\r
      }\r
      '''

  ### MV_STATIC_GET_TEMPLATE Value:
      '''static %(type)s get_%(name)s(){\r
          return %(cls_type)s::%(name)s;\r
      }\r
      '''

  ### MV_SET_TEMPLATE Value:
      '''static void set_%(name)s( %(cls_type)s inst, %(type)s new_value ){
      \r
          inst.%(name)s = new_value;\r
      }\r
      '''

  ### MV_STATIC_SET_TEMPLATE Value:
      '''static void set_%(name)s( %(type)s new_value ){ \r
          %(cls_type)s::%(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)