Class IORegistry
#include <IORegistry.h >
Class to represent each registered MAE I/O resource.
DbRecNum id |
db table record id; 0 for empty record Default value: 0 |
Constructor with optional db table record id.
const string& name |
the resource name to fetch |
Constructor with unique resource name.
const HashArray& data |
key-value pairs with property names as keys |
Constructor with input from HashArray.
Reset/Clear the contents of this instance
Determine if this instance has valid data or no.
Return value: true if valid; flase if not valid
Get the value of Table record id.
Return value: the value of id
Get the value of Name of the resource.
Return value: the value of name
Get the value of Type of resource (file, socket, etc.).
Return value: the value of type
Return true if the type is a directory
Return value: true if it's a directory, false otherwise
Return true if the resource is in the MAE filesystem.
Return value: true if it's in the filesystem, false otherwise
Get the value of Name of spoke for resource.
Return value: the value of spoke
Get the value of Path to resource.
Return value: the value of path
Get the value of Parameters to accessing the resource.
Return value: the value of params
const string& key |
const string& key |
Get the value of State of the resource (IOR_OPEN, IOR_UNKNOWN, IOR_CLOSED).
Return value: the value of state
Get the label of State of the resource (open, unknown, closed).
Return value: the label of state
string key |
the propery name to get (case insensitive) |
Given a IORegistry single property name (key), return its value as a string.
Return value: the string equivalent of the property
const string& newname |
the new value for name |
Set the value of Name of the resource.
Return value: the updated instance of IORegistry
const string& newtype |
the new value for type |
Set the value of Type of resource (file, socket, etc.).
Return value: the updated instance of IORegistry
const string& newspoke |
the new value for spoke |
Set the value of Name of spoke for resource.
Return value: the updated instance of IORegistry
const string& newpath |
the new value for path |
Set the value of Path to resource.
Return value: the updated instance of IORegistry
const HashArray& newparams |
the new value for params |
Set the value of Parameters to accessing the resource.
Return value: the updated instance of IORegistry
const string& key |
the key to set |
const string& value |
the value to set for the key (as string) |
Set a key-value pair in params.
Return value: the updated instance of IORegistry
const string& key |
the key to set |
long value |
the value to set for the key (as long) |
Set a key-value pair in params.
Return value: the updated instance of IORegistry
int newstate |
the new value for state |
Set the value of State of the resource (IOR_OPEN, IOR_UNKNOWN, IOR_CLOSED).
Return value: the updated instance of IORegistry
const HashArray& data |
Given a set of IORegistry properties in key-value pairs, initialize this instance with them.
This is complementary to toHashArray().
Return value: the initialized instance of IORegistry
string key |
the propery name to set (case insensitive) |
const string& value |
a string equivalent to assign (it will be converted) |
Given a IORegistry single property name (key) and a string value, assign the value to the property.
Return value: true upon success, false on failure (like invalid property name)
const HashArray& criteria |
key/value (field/value) pairs to find |
const string& sortby |
sort the resulting list by this field name Default value: "" |
Given field/value criteria, find matching record ids.
Return value: list of IORegistry record ids matching the criteria
const string& criteria |
an expression of fields, comparators, parenthesis and logic ops |
const string& sortby |
sort the resulting list by this field name Default value: "" |
Given criteria expression, find matching record ids.
Return value: list of IORegistry record ids matching the criteria
Find all IORegistry record ids.
Return value: list of all IORegistry record ids
bool forDB |
false to include Id; true to exclude Id, which is handy for sending to Datastore Default value: false |
Convert this instance's data into a HashArray.
This is the complement of set()
Return value: a HashArray of instance's properties
bool forDB |
false to include Id; true to exclude Id, which is handy for sending to Datastore Default value: false |
Convert this instance's data to XML.
Return value: a XMLData of instance's properties
Save this record to the Datastore.
If the data has not changed, it is not saved.
Return value: the Id upon success, 0 on failure
Delete the record from the Datastore.
Return value: true if successfully deleted; false on error (like id==0 or DB error)
const HashArray& values |
key/value pairs for field assignments |
Add a new record to the Datastore.
If the Id field is set, it will be used; if 0, a new Id will be assigned.
Return value: the new record's record Id
Add a new record to the Datastore.
If the Id is set, it will be used; if 0, a new Id will be assigned.
Return value: the new record's record Id
DbRecNum id |
the id of the record to fetch |
Method needed by the Cache class to fetch a record from the datastore.
Return value: the fetched record; check valid() for success of operation
DbRecNum id |
the id of the record to load |
Load data from the Datastore with the provided Id.
Return value: true upon success; false upon faliure
DbRecNum id |
Table record id |
string name |
Name of the resource |
string type |
Type of resource (file, socket, etc.) |
string spoke |
Name of spoke for resource |
string path |
Path to resource |
HashArray params |
Parameters to accessing the resource |
int state |
State of the resource (IOR_OPEN, IOR_UNKNOWN, IOR_CLOSED) |
bool changed |
Flag: true if any data in this instance has changed |
static Datastore db |
Our connection to DB table data |
Make sure we're connected to our table in the Datastore
Return value: true upon success, false upon failure