Package pyplusplus :: Package code_creators :: Module member_variable :: Class mem_var_ref_wrapper_t

# type mem_var_ref_wrapper_t

source code

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

Creates C++ code that creates accessor for class member variable, that has type reference.

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
| GET_TEMPLATE = ``'``static %(type)s get_%(name)s( %(class_type)s&` `...``
| SET_TEMPLATE = ``'``static void set_%(name)s( %(class_type)s& inst``...``
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

### GET_TEMPLATE

Value:

      '''static %(type)s get_%(name)s( %(class_type)s& inst ) {\r
          return inst.%(name)s;\r
      }\r
      '''

### SET_TEMPLATE

Value:

      '''static void set_%(name)s( %(class_type)s& inst, %(type)s new_value
      ){ \r
          inst.%(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)