Deeploy.AbstractDataTypes.Pointer

class Deeploy.AbstractDataTypes.Pointer(_value: str | None | Pointer, ctxt: _NetworkContext | None = None)

Bases: BaseType[str | None, Pointer]

Represents a C Pointer type to an underlying BaseType data type

Methods

__init__(_value: str | None | Pointer, ctxt: _NetworkContext | None = None)

Initializes a pointer to a registered object in the NetworkContext

Parameters:
  • _value (Union[Optional[str], Pointer]) – Name of the memory buffer in the NetworkContext to be represented or Pointer object

  • ctxt (Optional[_NetworkContext]) – Current NetworkContext

Raises:

ValueError – Raises a ValueError if the memory buffer does not exist or cannot be pointed to with this Pointer class

__init__(_value[, ctxt])

Initializes a pointer to a registered object in the NetworkContext

checkPromotion(_value[, ctxt])

Checks whether a given Python-typed or Deeploy-typed value can be represented with the Deeploy type

checkValue(value[, ctxt])

Checks whether a given Python-type value (usually FP64) can be represented with a Deeploy type

Attributes

referenceName

Either NULL iff this pointer corresponds to a NULL pointer in C, or the name of the memory buffer this pointer points to.

typeName

The C typename of this type

value

referencedType

type definition of the underlying type that this type points to

typeWidth

the number of BITS to be assigned to the type

referencedType: Type[_DeeployType]

type definition of the underlying type that this type points to

Type:

Type[_DeeployType]

typeName: str

The C typename of this type

Type:

str

classmethod checkValue(value: str | None, ctxt: _NetworkContext | None = None) bool

Checks whether a given Python-type value (usually FP64) can be represented with a Deeploy type

Parameters:
  • value (_PythonType) – Python-typed value to check

  • ctxt (Optional[_NetworkContext]) – Current NetworkContext

Returns:

Returns true if value can represented by cls

Return type:

bool

classmethod checkPromotion(_value: str | None | Pointer, ctxt: _NetworkContext | None = None) bool

Checks whether a given Python-typed or Deeploy-typed value can be represented with the Deeploy type

Parameters:
  • value (Union[_PythonType, _DeeployType]) – Python-typed or Deeploy-typed value to be checked for promotion to cls

  • ctxt (Optional[_NetworkContext]) – Current NetworkContext

Returns:

Returns true if the value can be promoted to cls

Return type:

bool

referenceName

Either NULL iff this pointer corresponds to a NULL pointer in C, or the name of the memory buffer this pointer points to.

Type:

str

typeWidth: int

the number of BITS to be assigned to the type

Type:

int