#include <dts.h>
Public Member Functions | |
DTS () | |
Construct a new DTS. | |
int | fromstring (dts_typeid, const char *datastr, DtsObject data) |
int | dts_lt (int type, void *p1, int len1, void *p2, int len2) |
void | send_message (DtsObject, dts_field_element, dts_comparison *) |
Send the given object to the given field of all objects that satisfy the comparison. | |
DtsObject | msg_check (DtsObject o, dts_field_element field) |
Check for a message for this obejct and field. | |
void | use_master () |
Make field and type values the same as a master process. | |
Factory Methods | |
DtsObject | construct (dts_typeid, void *data) |
Construct a new object with a copy of the given data. | |
DtsObject | construct_fromstring (dts_typeid type, const char *data) |
Construct a new object with data parsed from the given string. | |
DtsObject | newObject (dts_typeid) |
Return a new object of the given type. | |
DtsObject | newObject (dts_typeid, int size) |
Return a new object of the given type and size. | |
DtsObject | readObject (struct pickle *pickle, int fd) |
Field IDs | |
DtsObjects expose 0 or more fields (attributes) that can be accessed.
Each field is assigned a numeric identifier, a DtsField, specific to this runtime environment. Fields names can be nested (e.g. "foo.bar.baz") which translates to nested numeric IDs (e.g. "1.3.2"). It is recommended for performance that modules convert type names to IDs sparingly and cache results. | |
DtsField | requirefield (const char *name) |
Convert the given field name into a numeric identifier. | |
std::string | field_getname (DtsField &f) |
Find the location, size, and type of a field of the specified object. | |
std::string | field_getname (dts_field_element f) |
Return the name of the specified field. | |
Type IDs | |
Types are dynamically loaded classes.
Each type is assigned a numeric identifier specific to this runtime environment. All DtsObjects are typed with these values. It is recommended for performance that modules convert type names to IDs sparingly and cache results. | |
dts_typeid | requiretype (const char *name) |
Load the specified type module (if it is not already loaded) and return the dynamically assigned numeric identifier for that type. | |
dts_typeid | typenum_byname (const std::string &name) |
If the specified type module is already loaded, this result is the same as requiretype(). | |
char * | typename_bynum (const dts_typeid) |
Return the name of the given type. | |
struct dts_type * | type_bynum (const dts_typeid id) |
Return the type structure for the given type. | |
int | type_size (const dts_typeid type) |
Return the size (in bytes) of the specified type. | |
Interface to data testing system | |
int | parsetest (dts_comparison *comp, char *test) |
int | match (DtsObject datum, dts_comparison *comps) |
dts_comparison * | parse_tests (std::string) |
struct dts_operand * | parse_expr (std::string) |
Warnings | |
void | set_no_warnings () |
Don't warn. | |
bool | warn_missing_fields () |
Get current setting. | |
Public Attributes | |
ThreadSafeStack< DtsObject > | freelist |
This freelist should only be used by the DtsObject implementation. | |
Friends | |
int | yysmacql_parse () |
int | yydatalogparse () |
int | yyfilterparse () |
int | yyexprparse () |
You probably only want one instance of the DTS for your entire program. Factory methods are used to construct DtsObjects, which are typed using the DTS.
DTS::DTS | ( | ) |
Construct a new DTS.
You probably only want your program to use pointers to a single instance for the whole program.
DtsObject DTS::construct | ( | dts_typeid | type, | |
void * | data | |||
) |
Construct a new object with a copy of the given data.
The amount of data copied is determined by the requested typeid.
DtsObject DTS::construct_fromstring | ( | dts_typeid | type, | |
const char * | data | |||
) |
Construct a new object with data parsed from the given string.
The input string should be format accordingly for the given typeid.
std::string DTS::field_getname | ( | DtsField & | f | ) |
Find the location, size, and type of a field of the specified object.
Return the name of the specified field.
dts_typeid DTS::requiretype | ( | const char * | name | ) |
Load the specified type module (if it is not already loaded) and return the dynamically assigned numeric identifier for that type.
Didn't already exist, so do it the hard way
int DTS::type_size | ( | const dts_typeid | type | ) | [inline] |
Return the size (in bytes) of the specified type.
-1 if size is variable, -2 if type doesn't exist.
int DTS::typenum_byname | ( | const std::string & | name | ) | [inline] |
If the specified type module is already loaded, this result is the same as requiretype().
Unlike requiretype(), if the type is not loaded, -1 is returned.
This freelist should only be used by the DtsObject implementation.
When an object is freed, it can be put on the freelist instead of being destroyed. newObject() will use objects on the freelist before constructing new objects.