CstdTypes

Inheritance diagram of ccg.types.CstdTypes.CStdType
class ccg.types.CstdTypes.CStdType(name, bit_size=None, hungarian_prefixes=None, derived_from=None, in_space=None, doc=None)

Bases: ccg.types.Ctypes.CGenericType

Standard Type

Parameters
  • name (str) –

  • bit_size (Optional[int]) –

  • hungarian_prefixes (Optional[List[str]]) –

  • derived_from (Optional[CGenericType]) –

  • in_space (Optional[CSpace]) –

  • doc (Optional[Doc]) –

literal_suffix(style)
Parameters

style (Style) –

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)

Type declaration

Parameters
  • style (Style) – generating style

  • semicolon (bool) – include semicolon in declaration

  • doc (bool) – include documentation

  • from_space (CSpace) – relative to space

  • without_arguments (bool) – include arguments if any

  • for_variable (bool) – if the declaration is for a variable

Return type

str

Returns:

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]
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.CstdTypes.CIntegerType
class ccg.types.CstdTypes.CIntegerType(name, hungarian_prefixes, bits, is_signed)

Bases: ccg.types.CstdTypes.CStdType

Integer Type

Parameters
  • name (str) –

  • hungarian_prefixes (Optional[List[str]]) –

  • bits (int) –

  • is_signed (bool) –

literal_suffix(style)
Parameters

style (Style) –

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

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

Type declaration

Parameters
  • style (Style) – generating style

  • semicolon (bool) – include semicolon in declaration

  • doc (bool) – include documentation

  • from_space (CSpace) – relative to space

  • without_arguments (bool) – include arguments if any

  • for_variable (bool) – if the declaration is for a variable

Return type

str

Returns:

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]
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

class ccg.types.CstdTypes.StdTypes

Bases: object

Cint8 = <ccg.types.CstdTypes.CIntegerType object>
Cuint8 = <ccg.types.CstdTypes.CIntegerType object>
Cint16 = <ccg.types.CstdTypes.CIntegerType object>
Cuint16 = <ccg.types.CstdTypes.CIntegerType object>
Cint32 = <ccg.types.CstdTypes.CIntegerType object>
Cuint32 = <ccg.types.CstdTypes.CIntegerType object>
Cint64 = <ccg.types.CstdTypes.CIntegerType object>
Cuint64 = <ccg.types.CstdTypes.CIntegerType object>
Cfloat = <ccg.types.CstdTypes.CStdType object>
Cdouble = <ccg.types.CstdTypes.CStdType object>
Cbool = <ccg.types.CstdTypes.CStdType object>