INGOR
Public Member Functions | List of all members
ytObject Class Reference

The basis class. More...

#include <ytObject.h>

Public Member Functions

ytObjectytObject_new (ytType type)
 Generates a default instance of the given type. More...
 
void ytObject_delete (ytObject *this)
 Deletes the ytObject instance.
 
ytType ytObject_type (const ytObject *this)
 Returns the type of this ytObject instance. More...
 
ytObjectytObject_clone (const ytObject *this)
 Returns the copy of the given ytObject.
 
ytObjectytObject_parse (ytType type, const char *str)
 Parses the string expression of the value as the given type. More...
 
void ytObject_print (const ytObject *this, FILE *fp)
 Prints the string expression of the value.
 
void ytObject_printBuff (const ytObject *this, char **buff, size_t *size)
 Prints the contents of the object in the specified buffer.
 
size_t ytObject_size (const ytObject *this)
 Returns the memory size required for making a deep copy of the object.
 
ytByte * ytObject_serialize (const ytObject *this, ytByte **pptr)
 Serializes the object in the memory. More...
 
ytObjectytObject_deserialize (ytByte **const pptr)
 De-serializes the object serialized in the memory.
 

Detailed Description

The basis class.

See also
ytValue

Member Function Documentation

◆ ytObject_new()

ytObject * ytObject_new ( ytType  type)

Generates a default instance of the given type.

Parameters
typeytType
Returns
pointer to the generated instance.

◆ ytObject_parse()

ytObject * ytObject_parse ( ytType  type,
const char *  str 
)

Parses the string expression of the value as the given type.

Parameters
typeValue type
strstring expression of the value to parse.
Returns
parsed value as a ytObject instance, or NULL if failed to parse.

◆ ytObject_serialize()

ytByte * ytObject_serialize ( const ytObject this,
ytByte **  pptr 
)

Serializes the object in the memory.

This returns the pointer to the memory where the given object is serialized.

The serialized memory image can be de-serialized (recovered).

Parameters
thispointer to the object to be serialized.
ptrpointer to the memory to serialize. NULL can be specified. If so, memory is newly allocated and returned.
Returns
pointer to the memory where the given object is serialized.

◆ ytObject_type()

ytType ytObject_type ( const ytObject this)

Returns the type of this ytObject instance.

Parameters
thisytObject instance
Returns
the type of given ytObject instance as ytType.

The documentation for this class was generated from the following file: