INGOR
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ytValue Class Reference

Wrapper class for primitive and other arbitrary types. More...

#include <ytValue.h>

Public Member Functions

ytObjectytValue_obj (ytValue *val)
 Returns a ytObject pointer of the ytValue instance.
 
ytObjectytValue_newObject (void *ptr, ytType type)
 Creates a new ytValue instance that wraps given value, and returns it as a pointer to ytObject.
 
void * ytValue_ptr (ytObject *this)
 Returns the pointer to which this ytValue instance points.
 
ytObjectytValue_int (int value)
 Returns the ytObject representing the given integer value.
 
int ytValue_intValue (const ytObject *obj)
 Returns integer value.
 
void ytValue_intSet (ytObject *obj, int value)
 Sets an integer value in the ytType_INT ytObject instance.
 
ytObjectytValue_double (double value)
 
double ytValue_doubleValue (const ytObject *obj)
 Returns a double value.
 
void ytValue_doubleSet (ytObject *obj, double value)
 Sets a double integer value in the ytType_DOUBLE ytObject instance.
 
ytObjectytValue_str (char *ptr)
 Returns the ytObject instance containing the given char pointer.
 
ytObjectytValue_strCopy (const char *ptr)
 Returns the ytObject instance containing the copy of the given char pointer.
 
char * ytValue_strValue (const ytObject *obj)
 Converts ytObjbect of type ytType_CHAR_P to char pointer.
 
ytObjectytValue_size_t (size_t value)
 Returns the ytObject instance representing the given size_t value.
 
size_t ytValue_size_tValue (const ytObject *obj)
 Returns a size_t value of this object.
 
void ytValue_delete (void *this)
 Deletes the ytValue instance.
 

Public Attributes

ytObject obj
 
void * ptr
 

Detailed Description

Wrapper class for primitive and other arbitrary types.

This class is designed to provide a wrapper container class for mainly primitive types such as int, double and so on. This enables us to handle primitive typed values as ytObject class instances.

Member Function Documentation

◆ ytValue_delete()

void ytValue_delete ( void *  this)

Deletes the ytValue instance.

This deletes both the ytValue instance and one pointed from this ytValue instance. To surpress this behaviour, set NULL before calling this routine.

Parameters
thispointer to the ytValue instance to delete.

◆ ytValue_double()

ytObject * ytValue_double ( double  value)

\ brief Returns the ytObject representing the given double value.

◆ ytValue_doubleValue()

double ytValue_doubleValue ( const ytObject obj)

Returns a double value.

Parameters
obj

◆ ytValue_int()

ytObject * ytValue_int ( int  value)

Returns the ytObject representing the given integer value.

See also
ytValue_intValue()

◆ ytValue_intValue()

int ytValue_intValue ( const ytObject obj)

Returns integer value.

The object type must be ytType_INT.

Parameters
obj
Returns
integer value.

◆ ytValue_newObject()

ytObject * ytValue_newObject ( void *  ptr,
ytType  type 
)

Creates a new ytValue instance that wraps given value, and returns it as a pointer to ytObject.

Parameters
ptr
type

◆ ytValue_obj()

ytObject * ytValue_obj ( ytValue val)

Returns a ytObject pointer of the ytValue instance.

Parameters
valytValue instance
Returns
pointer to the ytObject instance.

◆ ytValue_size_t()

ytObject * ytValue_size_t ( size_t  value)

Returns the ytObject instance representing the given size_t value.

Parameters
value

◆ ytValue_size_tValue()

size_t ytValue_size_tValue ( const ytObject obj)

Returns a size_t value of this object.

Parameters
obj

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