SolarCapture C Bindings User Guide  SF-115721-CD
Draft 2A
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
object.h File Reference

sc_object: Opaque object interface. Use this to pass all types of data that are not ints, doubles or char arrays (see SC_PARAM_INT, SC_PARAM_DBL and SC_PARAM_STR respectively for these). More...

Enumerations

enum  sc_object_type {
  SC_OBJ_ANY, SC_OBJ_OPAQUE, SC_OBJ_PKT_PREDICATE, SC_OBJ_C_ATTR,
  SC_OBJ_NODE, SC_OBJ_POOL
}
 The type of data the sc_object contains. More...
 

Functions

enum sc_object_type sc_object_type (struct sc_object *obj)
 Return the type of data contained within the sc_object. More...
 
int sc_opaque_alloc (struct sc_object **obj_out, void *opaque)
 Allocate memory for an opaque sc_object. More...
 
void sc_opaque_free (struct sc_object *obj)
 Free an sc_object previously allocated using sc_opaque_alloc. Only use this to free an opaque sc_object. The underlying data wrapped by this object will not be freed. More...
 
void sc_opaque_set_ptr (struct sc_object *obj, void *opaque)
 Set the opaque pointer in an sc_object. More...
 
void * sc_opaque_get_ptr (const struct sc_object *obj)
 Get the opaque pointer stored in an sc_object. More...
 

Detailed Description

sc_object: Opaque object interface. Use this to pass all types of data that are not ints, doubles or char arrays (see SC_PARAM_INT, SC_PARAM_DBL and SC_PARAM_STR respectively for these).

Enumeration Type Documentation

The type of data the sc_object contains.

Enumerator
SC_OBJ_OPAQUE 

An opaque pointer

SC_OBJ_PKT_PREDICATE 

A packet predicate (see sc_pkt_predicate)

SC_OBJ_C_ATTR 

Const attributes (see sc_attr)

SC_OBJ_NODE 

A node (see sc_node)

SC_OBJ_POOL 

A packet pool

Function Documentation

enum sc_object_type sc_object_type ( struct sc_object obj)

Return the type of data contained within the sc_object.

Parameters
objThe object to check the data type of.
Returns
The type of data contained within the sc_object.
int sc_opaque_alloc ( struct sc_object **  obj_out,
void *  opaque 
)

Allocate memory for an opaque sc_object.

Parameters
obj_outOn success the allocated object.
opaqueA pointer to the data to be wrapped by the object.
Returns
0 on success.
void sc_opaque_free ( struct sc_object obj)

Free an sc_object previously allocated using sc_opaque_alloc. Only use this to free an opaque sc_object. The underlying data wrapped by this object will not be freed.

Parameters
objThe object to free
void* sc_opaque_get_ptr ( const struct sc_object obj)

Get the opaque pointer stored in an sc_object.

Parameters
objThe object to fetch the opaque pointer from.
Returns
The opaque pointer.
void sc_opaque_set_ptr ( struct sc_object obj,
void *  opaque 
)

Set the opaque pointer in an sc_object.

Parameters
objThe object to set the pointer on
opaqueThe new opaque pointer to use