Cfunction

Inheritance diagram of ccg.types.Cfunction.CFunction
class ccg.types.Cfunction.CFunction(name, return_type=<ccg.types.Ctypes.CGenericType object>, arguments=None, content=None, in_space=None, static=False, doc=None)

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

Function

Parameters
Argument

alias of ccg.types.Cfunction.CFunctionArgument

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

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

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

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

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

Inheritance diagram of ccg.types.Cfunction.CFunctionArgument
class ccg.types.Cfunction.CFunctionArgument(name, c_type, default=None, auto_hungarize=False, doc=None)

Bases: ccg.Cvariable.CVariable

Argument of a function or method

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