PISOFT::TEObjectContainer
#include <teobjcontainer.h>
The TEObjectContainer class defines a container for objects and provides methods for managing those objects.
© Pi Soft, 2018-2026 · Tricryption Engine 8.1
Public Member Functions
| Member | Description |
|---|---|
TEObjectContainer() | The TEObjectContainer constructor is the default class constructor. |
TEObjectContainer(const TEObjectContainer &) | The TEObjectContainer constructor copies an object and saves the copy in a new container. |
~TEObjectContainer() | The TEObjectContainer destructor is the class destructor. |
const TEObject * operator[](uint32_t idx) const | The [] operator returns a constant pointer to the object at the position indicated by the given index. |
TEObject * operator[](uint32_t idx) | The [] operator returns a pointer to the object at the position indicated by the given index. |
const TEObjectTemplate< T > * getAs(uint32_t idx) const | The getAs method returns the element at the given index as a TEObjectTemplate<T>, CHECKED: the element's type tag (TEObject::typeName) must be T's. |
TEObjectTemplate< T > * getAs(uint32_t idx) | The non-constant form of getAs. |
const TEObject * checkedAt(uint32_t idx, const char *expected) const | The checkedAt method returns the element at the given index after checking the index and that the element's type tag equals the given one; getAs calls it. |
TEObjectContainer & operator=(const TEObjectContainer &container) | The = operator assigns all objects in a container to another container. The objects in the destination container are cleared before the assignment. After the assignment the objects in the destination container are cloned objects from those in the original container. |
void insert(uint32_t idx, const TEObject *teobj) | The insert method inserts an object in a container. A copy of the object will be created. |
void add(const TEObject *teobj) | The add method adds an object to the container. A copy of the object will be created. |
uint32_t size() const | The size method gets the size of the container. |
bool empty() const | The empty method checks whether a container is empty. |
void clear() | The clear method clears all objects from a container. |
void erase(uint32_t idx) | The erase method erases an objects from a container. |
Member Function Documentation
TEObjectContainer()
The TEObjectContainer constructor is the default class constructor.
TEObjectContainer(const TEObjectContainer &)
The TEObjectContainer constructor copies an object and saves the copy in a new container.
~TEObjectContainer()
The TEObjectContainer destructor is the class destructor.
const TEObject * operator[](uint32_t idx) const
The [] operator returns a constant pointer to the object at the position indicated by the given index.
Parameters
| Parameter | Description |
|---|---|
idx | Index of the object to be obtained. |
Returns: Returns a constant pointer to the object.
TEObject * operator[](uint32_t idx)
The [] operator returns a pointer to the object at the position indicated by the given index.
Parameters
| Parameter | Description |
|---|---|
idx | Index of the object to be obtained. |
Returns: Returns a pointer to the object.
const TEObjectTemplate< T > * getAs(uint32_t idx) const
The getAs method returns the element at the given index as a TEObjectTemplate<T>, CHECKED: the element's type tag (TEObject::typeName) must be T's.
A container is heterogeneous – ids (TEOID, a 64-bit te_oid) and TEUInt32 values share it – so an unchecked cast of an element to the wrong template reads the wrong width and returns a number. Use getAs<te_oid>(i) to read an id.
Parameters
| Parameter | Description |
|---|---|
idx | Index of the object to be obtained. |
Exceptions
| Exception | Description |
|---|---|
TEAgentException | naming the index, the expected and the actual type, when the element is of another type or the index is out of range. |
Returns: Returns a pointer to the typed object; never NULL.
TEObjectTemplate< T > * getAs(uint32_t idx)
The non-constant form of getAs.
const TEObject * checkedAt(uint32_t idx, const char *expected) const
The checkedAt method returns the element at the given index after checking the index and that the element's type tag equals the given one; getAs calls it.
Parameters
| Parameter | Description |
|---|---|
idx | Index of the object to be obtained. |
expected | The type tag the caller requires (TEObjectTypeName<T>::name()). |
Exceptions
| Exception | Description |
|---|---|
TEAgentException | naming the index, the expected and the actual type. |
Returns: Returns a constant pointer to the object; never NULL.
TEObjectContainer & operator=(const TEObjectContainer &container)
The = operator assigns all objects in a container to another container. The objects in the destination container are cleared before the assignment. After the assignment the objects in the destination container are cloned objects from those in the original container.
Parameters
| Parameter | Description |
|---|---|
container | Specifies a container whose objects will be assigned to the current container. |
Returns: Returns a reference to the current container object.
void insert(uint32_t idx, const TEObject *teobj)
The insert method inserts an object in a container. A copy of the object will be created.
Parameters
| Parameter | Description |
|---|---|
idx | Position where the object will be inserted. |
teobj | Pointer to the object to be inserted. |
void add(const TEObject *teobj)
The add method adds an object to the container. A copy of the object will be created.
Parameters
| Parameter | Description |
|---|---|
teobj | Pointer to the object to be added. |
uint32_t size() const
The size method gets the size of the container.
Returns: Returns the size of the container.
bool empty() const
The empty method checks whether a container is empty.
Returns: Returns a boolean value indicating whether the container is empty; TRUE = container is empty, FALSE = container is not empty.
void clear()
The clear method clears all objects from a container.
void erase(uint32_t idx)
The erase method erases an objects from a container.
Parameters
| Parameter | Description |
|---|---|
idx | The position from which the object will be erased. |
Examples
- cpp_admin_acl_addentry.cpp
- cpp_admin_acl_get.cpp
- cpp_admin_acl_removeentry.cpp
- cpp_admin_acl_update.cpp
- cpp_admin_group_addto_1.cpp
- cpp_admin_group_addto_2.cpp
- cpp_admin_group_removefrom_1.cpp
- cpp_admin_group_removefrom_2.cpp
- cpp_admin_others_getoperationlist.cpp
- cpp_admin_principal_acltemplate_set.cpp
- cpp_admin_principal_add.cpp
- cpp_admin_principal_defaultgroup_set.cpp
- cpp_admin_principal_getList.cpp
- cpp_admin_principal_getbyid_3.cpp
- cpp_admin_principal_group_add.cpp
- cpp_admin_principal_group_clear.cpp
- cpp_admin_principal_group_get.cpp
- cpp_admin_principal_group_remove.cpp
- cpp_admin_principal_reviewer_add.cpp
- cpp_admin_principal_reviewer_clear.cpp
- cpp_admin_principal_reviewer_get.cpp
- cpp_admin_principal_reviewer_remove.cpp
- cpp_admin_query.cpp
- cpp_admin_role_assignto.cpp
- cpp_admin_role_getlist.cpp
- cpp_admin_role_removefrom.cpp
- cpp_admin_trustedserver.cpp
- cpp_adminacl_acltemplate_add.cpp
- cpp_adminacl_acltemplate_get.cpp
- cpp_adminacl_acltemplate_remove.cpp
- cpp_adminacl_acltemplate_update.cpp
- cpp_adminacl_templatedir_add.cpp
- cpp_adminacl_templatedir_get.cpp
- cpp_adminacl_templatedir_remove.cpp
- cpp_adminacl_templatedir_update.cpp
- cpp_adminlocal_getstatus.cpp
- cpp_adminlocal_setconfiguration.cpp
- cpp_adminlocal_setstatus.cpp
- cpp_export_key.cpp
- cpp_matrix_hash.cpp