Choco OS  V.0.16.9.0
Join to the chocolate world
Object

Macros

#define oC_OBJECTS_REGISTRATIONS_LIST(ADD_OBJECT)
 list of object registrations More...
 
#define oC_ObjectId_(Name)   oC_1WORD_FROM_2(oC_ObjectId_ , Name)
 returns name of the object id created for the object
 

Typedefs

typedef uint32_t oC_ObjectControl_t
 stores object control value More...
 

Enumerations

Functions

static oC_ObjectControl_t oC_CountObjectControl (void *ObjectPointer, oC_ObjectId_t ObjectId)
 counts object control for object More...
 
static oC_ObjectId_t oC_GetObjectId (oC_ObjectControl_t ObjectControl)
 returns id of object More...
 
static bool oC_CheckObjectControl (void *ObjectPointer, oC_ObjectId_t ObjectId, oC_ObjectControl_t ObjectControl)
 checks if object control is correct More...
 

Detailed Description

Macro Definition Documentation

#define oC_OBJECTS_REGISTRATIONS_LIST (   ADD_OBJECT)

The macro is for storing list of objects. To add object to the list just use macro ADD_OBJECT in format:

 ADD_OBJECT(ObjectName) \

Example:

#define oC_OBJECTS_REGISTRATIONS_LIST(ADD_OBJECT) \
ADD_OBJECT(Thread) \
ADD_OBJECT(OtherObject) \
ADD_OBJECT(MyObject) \

Definition at line 63 of file oc_object.h.

Typedef Documentation

typedef uint32_t oC_ObjectControl_t

The type is for storing object control value. It should be included to the object structure.

Definition at line 141 of file oc_object.h.

Enumeration Type Documentation

Each object in the oC_OBJECTS_REGISTRATIONS_LIST list has assigned own ID number, that can be stored in this type.

Enumerator
oC_OBJECTS_REGISTRATIONS_LIST 

oC_ObjectId_Thread

oC_ObjectId_NumberOfElements

oC_ObjectId_Mask 

oC_ObjectId_Mask

Definition at line 122 of file oc_object.h.

Function Documentation

static bool oC_CheckObjectControl ( void *  ObjectPointer,
oC_ObjectId_t  ObjectId,
oC_ObjectControl_t  ObjectControl 
)
inlinestatic

The function is for checking if the object control value is correct for this object. It can be used for protection again usage of wrong pointers in the object functions.

Parameters
ObjectPointerPointer to the object
ObjectIdId of the object
ObjectControlObject control value
Returns
true if object control is correct

Definition at line 203 of file oc_object.h.

static oC_ObjectControl_t oC_CountObjectControl ( void *  ObjectPointer,
oC_ObjectId_t  ObjectId 
)
inlinestatic

The function is for counting special key, that is assigned for each object for protection again wrong pointers given to object functions. Objects cannot be copied without recounting object control value. The function is not checking if the pointer is correct.

Parameters
ObjectPointerPointer to the object
ObjectIdId of the object
Returns
object control value

Definition at line 168 of file oc_object.h.

static oC_ObjectId_t oC_GetObjectId ( oC_ObjectControl_t  ObjectControl)
inlinestatic

The function returns id of object stored in the object control value.

Parameters
ObjectControlObject control value
Returns
id of object

Definition at line 184 of file oc_object.h.