core/object.h File Reference


Detailed Description

Id
object.h,v 1.55 2008/01/29 23:40:30 d3p988 Exp

Definition in file object.h.

Go to the source code of this file.

Classes

struct  s_callbacks
struct  s_callbacks::s_objvar_name_struct
struct  s_callbacks::s_objvar_struct
struct  s_object_list

Defines

#define GETADDR(O, P)   (O?((void*)((char*)(O+1)+(unsigned int64)((P)->addr))):NULL)
 get the addr of an object's property
#define MYPARENT   ((((OBJECT*)this)-1)->parent)
 get the parent from the object's data structure
#define object_id(X)   ((X)?(X)->id:-1)
 get the id of the object X
#define object_parent(X)   ((X)?(X)->parent:NULL)
 get the parent of the object
#define object_rank(X)   ((X)?(X)->name:-1)
 get the rank of the object
#define object_size(X)   ((X)?(X)->size:-1)
 get the size of the object X
#define OBJECTDATA(X, T)   ((T*)((X)?((X)+1):NULL))
 get the object data structure
#define OBJECTHDR(X)   ((X)?(((OBJECT*)X)-1):NULL)
 get the header from the object's data structure
#define OF_HASPLC   0x0001
 Object flag; external PLC is attached, disables local PLC.
#define OF_LOCKED   0x0002
 Object flag; data write pending, reread recommended after lock clears.
#define OF_NONE   0x0000
 Object name Object flag; none set.
#define OF_RECALC   0x0008
 Object flag; recalculation of derived values is needed.
#define OF_RERANK   0x4000
 Internal use only.

Typedefs

typedef s_callbacks CALLBACKS
 core callback function table
typedef s_object_list OBJECT
 Object header structure.
typedef char * OBJECTNAME
 Object id number.
typedef unsigned int OBJECTNUM
 Object data size.
typedef unsigned int OBJECTRANK
 Object rank number.
typedef unsigned short OBJECTSIZE

Functions

int convert_from_latitude (double v, void *buffer, int bufsize)
int convert_from_longitude (double v, void *buffer, int bufsize)
double convert_to_latitude (char *buffer)
double convert_to_longitude (char *buffer)
OBJECTobject_create_array (CLASS *oclass, OBJECTSIZE size, unsigned int n_objects)
 Create multiple objects.
OBJECTobject_create_single (CLASS *oclass, OBJECTSIZE size)
 Create a single object.
int object_dump (char *outbuffer, int size, OBJECT *obj)
 Dump an object to a buffer.
OBJECTobject_find_by_id (OBJECTNUM id)
 Find an object by its id number.
OBJECTobject_find_name (OBJECTNAME name)
 Find an object from a name.
PROPERTYobject_flag_property (void)
void * object_get_addr (OBJECT *obj, char *name)
 Get the address of a property value.
complexobject_get_complex (OBJECT *obj, PROPERTY *prop)
complexobject_get_complex_by_name (OBJECT *obj, char *name)
complexobject_get_complex_quick (OBJECT *obj, PROPERTY *prop)
unsigned int object_get_count (void)
 Get the number of objects defined.
double * object_get_double (OBJECT *obj, PROPERTY *prop)
double * object_get_double_by_name (OBJECT *obj, char *name)
double * object_get_double_quick (OBJECT *obj, PROPERTY *prop)
OBJECTobject_get_first ()
 Get the first object in the model.
int16object_get_int16 (OBJECT *obj, PROPERTY *prop)
int16object_get_int16_by_name (OBJECT *obj, char *name)
int32object_get_int32 (OBJECT *obj, PROPERTY *prop)
int32object_get_int32_by_name (OBJECT *obj, char *name)
int64 * object_get_int64 (OBJECT *obj, PROPERTY *prop)
int64 * object_get_int64_by_name (OBJECT *obj, char *name)
OBJECTobject_get_next (OBJECT *obj)
 Get the next object in the model.
OBJECTobject_get_object (OBJECT *obj, PROPERTY *prop)
int object_get_oflags (KEYWORD **extflags)
PROPERTYobject_get_property (OBJECT *obj, PROPERTYNAME name)
 Get a named property of an object.
char * object_get_string (OBJECT *obj, PROPERTY *prop)
char * object_get_string_by_name (OBJECT *obj, char *name)
int object_get_value_by_addr (OBJECT *obj, void *addr, char *value, int size, PROPERTY *prop)
 Get a property value by reference to its physical address.
int object_get_value_by_name (OBJECT *obj, PROPERTYNAME name, char *value, int size)
 Get a value by reference to its property name.
int object_init (OBJECT *obj)
 Initialize an object.
int object_isa (OBJECT *obj, char *type)
 Tests the type of an object.
char * object_name (OBJECT *obj)
 Get the name of an object.
char * object_property_to_string (OBJECT *obj, char *name)
OBJECTobject_remove_by_id (OBJECTNUM id)
 Removes a single object.
int object_saveall (FILE *fp)
 Save all the objects in the model to the stream fp in the .GLM format.
int object_saveall_xml (FILE *fp)
 Save all the objects in the model to the stream fp in the .XML format.
int object_set_dependent (OBJECT *obj, OBJECT *dependent)
 Set the dependent of an object.
int object_set_double_by_name (OBJECT *obj, PROPERTYNAME name, double value)
void object_set_name (OBJECT *obj, OBJECTNAME name)
 Sets the name of an object.
int object_set_parent (OBJECT *obj, OBJECT *parent)
 Set the parent of an object.
int object_set_rank (OBJECT *obj, OBJECTRANK rank)
 Set the rank of an object but forcing it's parent to increase rank if necessary.
int object_set_value_by_addr (OBJECT *obj, void *addr, char *value, PROPERTY *prop)
 Set a property value by reference to its physical address.
int object_set_value_by_name (OBJECT *obj, PROPERTYNAME name, char *value)
 Set a property value by reference to its name.
TIMESTAMP object_sync (OBJECT *obj, TIMESTAMP ts, PASSCONFIG pass)
 Synchronize an object.


GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy