Cclass

Inheritance diagram of ccg.types.Cclass.CClass
class ccg.types.Cclass.CClass(name, inherit_from=None, members=None, doc=None)

Bases: ccg.types.Ctypes.CGenericType, ccg.types.Ctypes.CItemDefinable

Cpp class

Parameters
  • name (str) –

  • inherit_from (Optional[Union[CClassInheritance, List[CClassInheritance]]]) –

  • members (List[ccg.types.Cclass.CClassMember]) –

  • doc (Optional[Doc]) –

Access

alias of ccg.types.Cclass.CClassAccess

Attribute

alias of ccg.types.Cclass.CClassAttribute

Method

alias of ccg.types.Cclass.CClassMethod

Constructor

alias of ccg.types.Cclass.CClassConstructor

TypeMember

alias of ccg.types.Cclass.ClassTypeMember

Using

alias of ccg.types.Cclass.CClassUsing

Inherit

alias of ccg.types.Cclass.CClassInheritance

FreeStyle

alias of ccg.types.Cclass.CClassFreeStyleMember

declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None, without_arguments=False, for_variable=False)

Forward declaration of class

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

  • without_arguments (bool) –

  • for_variable (bool) –

Return type

str

property bit_size: int
check_value(value)

Checks that a value is correct for the type

Parameters

value (Any) – value to check

Returns

boolean indicating if value fits type (True) or not

Return type

bool

declare(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

define(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

definition(style=<ccg.style.Style object>, from_space=None, doc=True)

Definition of class with members

Parameters
  • style (Style) –

  • from_space (CSpace) –

  • doc (bool) –

Return type

str

doc_render(style)
Parameters

style (Style) –

Return type

str

property full_space_list: List[ccg.Cnamespace.CSpace]
space_def(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

str

type(name)

Create a copy of the type with a new name

Parameters

name (str) –

Return type

ccg.types.Ctypes.CGenericType

typedef(doc=None)
Parameters

doc (Optional[Doc]) –

Return type

ccg.statements.Cstatement.CStatement

typedef_render(style=<ccg.style.Style object>, from_space=None, doc=None)
Parameters
Return type

str

all_members_definition()

Collection of statements that define all members

Return type

ccg.statements.Cstatement.CStatements

style_checks(style)
Parameters

style (ccg.style.Style) –

Return type

None

property constructor
class ccg.types.Cclass.CClassAccess(value)

Bases: enum.Enum

An enumeration.

public = 0
protected = 1
private = 2
Inheritance diagram of ccg.types.Cclass.CClassAttribute
class ccg.types.Cclass.CClassAttribute(name, c_type, initial_value=None, access=<CClassAccess.private: 2>, static=False, const=False, constexpr=False, auto_hungarize=False, doc=None)

Bases: ccg.Cvariable.CVariable, ccg.types.Cclass.CClassMember

Attribute of class

Parameters
property bit_size: int
declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None, without_arguments=False)

All Class Members should inherit from a CGenericItem that contains a Declaration

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

  • without_arguments (bool) –

Return type

str

declare(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

doc_render(style)

All Class members should have a doc_render method

Parameters

style (Style) –

Return type

str

property full_space_list: List[ccg.Cnamespace.CSpace]
render(style=<ccg.style.Style object>)
Parameters

style (Style) –

Return type

str

space_def(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

str

style_checks(style)
Parameters

style (Style) –

Return type

None

Inheritance diagram of ccg.types.Cclass.CClassMethod
class ccg.types.Cclass.CClassMethod(name, return_type=<ccg.types.Ctypes.CGenericType object>, arguments=None, content=None, access=<CClassAccess.private: 2>, static=False, doc=None)

Bases: ccg.types.Cfunction.CFunction, ccg.types.Cclass.CClassMember

Method of class

Parameters
Argument

alias of ccg.types.Cfunction.CFunctionArgument

property bit_size: int
check_value(value)

Checks that a value is correct for the type

Parameters

value (Any) – value to check

Returns

boolean indicating if value fits type (True) or not

Return type

bool

declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None, without_arguments=False, for_variable=False)

Declaration of function

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

  • without_arguments (bool) –

  • for_variable (bool) –

Return type

str

declare(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

define(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

definition(style=<ccg.style.Style object>, from_space=None, doc=False)

Definition of function

Parameters
  • style (Style) –

  • from_space (CSpace) –

  • doc (bool) –

Return type

str

doc_render(style)

All Class members should have a doc_render method

Parameters

style (Style) –

Return type

str

property full_space_list: List[ccg.Cnamespace.CSpace]
space_def(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

str

style_checks(style)
Parameters

style (Style) –

Return type

None

type(name)

Create a copy of the type with a new name

Parameters

name (str) –

Return type

ccg.types.Ctypes.CGenericType

typedef(doc=None)
Parameters

doc (Optional[Doc]) –

Return type

ccg.statements.Cstatement.CStatement

typedef_render(style=<ccg.style.Style object>, from_space=None, doc=None)
Parameters
Return type

str

Inheritance diagram of ccg.types.Cclass.CClassConstructor
class ccg.types.Cclass.CClassConstructor(arguments=None, content=None, access=<CClassAccess.private: 2>)

Bases: ccg.types.Cclass.CClassMethod

Constructor of class

Parameters
Argument

alias of ccg.types.Cfunction.CFunctionArgument

property bit_size: int
check_value(value)

Checks that a value is correct for the type

Parameters

value (Any) – value to check

Returns

boolean indicating if value fits type (True) or not

Return type

bool

declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None, without_arguments=False, for_variable=False)

Declaration of function

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

  • without_arguments (bool) –

  • for_variable (bool) –

Return type

str

declare(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

define(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

ccg.statements.Cstatement.CDeclaration

definition(style=<ccg.style.Style object>, from_space=None, doc=False)

Definition of function

Parameters
  • style (Style) –

  • from_space (CSpace) –

  • doc (bool) –

Return type

str

doc_render(style)

All Class members should have a doc_render method

Parameters

style (Style) –

Return type

str

property full_space_list: List[ccg.Cnamespace.CSpace]
space_def(from_space=None)
Parameters

from_space (Optional[ccg.Cnamespace.CSpace]) –

Return type

str

style_checks(style)
Parameters

style (Style) –

Return type

None

type(name)

Create a copy of the type with a new name

Parameters

name (str) –

Return type

ccg.types.Ctypes.CGenericType

typedef(doc=None)
Parameters

doc (Optional[Doc]) –

Return type

ccg.statements.Cstatement.CStatement

typedef_render(style=<ccg.style.Style object>, from_space=None, doc=None)
Parameters
Return type

str

Inheritance diagram of ccg.types.Cclass.CClassMember
class ccg.types.Cclass.CClassMember(access=<CClassAccess.private: 2>)

Bases: abc.ABC

Member of class

Parameters

access (ccg.types.Cclass.CClassAccess) –

abstract declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None)

All Class Members should inherit from a CGenericItem that contains a Declaration

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

Return type

str

abstract doc_render(style)

All Class members should have a doc_render method

Parameters

style (ccg.style.Style) –

Return type

str

Inheritance diagram of ccg.types.Cclass.CClassFreeStyleMember
class ccg.types.Cclass.CClassFreeStyleMember(content, access=<CClassAccess.private: 2>, doc=None)

Bases: ccg.types.Cclass.CClassMember

Freestyle member for class

Parameters
declaration(style=<ccg.style.Style object>, semicolon=True, doc=True, from_space=None)

All Class Members should inherit from a CGenericItem that contains a Declaration

Parameters
  • style (Style) –

  • semicolon (bool) –

  • doc (bool) –

  • from_space (CSpace) –

Return type

str

doc_render(style)

All Class members should have a doc_render method

Parameters

style (ccg.style.Style) –

Return type

str