Go to the documentation of this file.
48 #ifndef CCXX_MISSING_H_
52 #ifndef CCXX_THREAD_H_
56 #define KEYDATA_INDEX_SIZE 97
57 #define KEYDATA_PAGER_SIZE 512
61 #define KEYDATA_PATH_SIZE 512
63 #define KEYDATA_PATH_SIZE PATH_MAX
66 #define KEYDATA_PATH_SIZE 256
69 #ifdef CCXX_NAMESPACES
197 typedef struct frame {
219 void *
push(
const void *
object,
size_t size);
227 void *
push(
const char *
string);
382 static std::ifstream *cfgFile;
397 unsigned getIndex(
const char *sym);
414 void load(
const char *keypath);
440 void loadFile(
const char *filepath,
const char *keys = NULL,
const char *pre = NULL);
534 const char *
getString(
const char *sym,
const char *def = NULL);
612 {
return getLast(keyword);};
643 inline void *
operator new(
size_t size,
MemPager &pager)
644 {
return pager.alloc(size);};
652 inline void *
operator new[](
size_t size,
MemPager &pager)
653 {
return pager.alloc(size);};
658 inline void operator delete(
void *) {};
663 inline void operator delete[](
void *) {};
791 #ifdef CCXX_NAMESPACES
bool isKey(const char *sym)
Find if a given key exists.
A container for objects that can be queued against a runlist.
Definition: misc.h:758
const char * keyword
Definition: misc.h:373
void setValue(const char *sym, const char *data)
Set (replace) the value of a given keyword.
void loadPrefix(const char *prefix, const char *keypath)
Load additional key values into the currrent object from the specfied config source (a config file/se...
const char ** list
Definition: misc.h:367
const char * getFirst(const char *sym)
Get the first data value for a given keyword.
Keysym * getSymbol(const char *sym, bool create)
void unlink(void)
Unlink the keydata object from the cache file stream.
int getCount(const char *sym)
Get a count of the number of data "values" that is associated with a specific keyword.
The Mutex class is used to protect a section of code so that at any given time only a single thread c...
Definition: thread.h:187
virtual void * getMemory(size_t size)=0
void load(const char *keypath)
Load additional key values into the currrent object from the specfied config source (a config file/se...
long getLong(const char *sym, long def=0)
Get a long value, with an optional default if missing.
unsigned getCount(void)
Get the count of keyword indexes that are actually available so one can allocate a table to receive g...
void setPointer(const char *id, void *data)
static void end(void)
static member to end keydata i/o allocations.
void loadFile(const char *filepath, const char *keys=NULL, const char *pre=NULL)
Load additional keys into the current object using a real filename that is directly passed rather tha...
void * getPointer(const char *id) const
bool getBool(const char *key)
Get a bool value.
This class is used to associate (object) pointers with named strings.
Definition: misc.h:675
Keydata objects are used to load and hold "configuration" data for a given application.
Definition: misc.h:353
void stoping(void)
Stop the object, called when stopping or ready completes.
#define __EXPORT
Definition: config.h:979
Keyval * next
Definition: misc.h:360
Keysym * next
Definition: misc.h:365
class __EXPORT Runlist
Definition: misc.h:73
virtual ~Keydata()
Destroy the keydata object and all allocated memory.
const char *const * getList(const char *sym)
Return a list of all values set for the given keyword returned in order.
Keydata()
Create an empty key data object.
Keydata(Define *pairs, const char *keypath=NULL)
Alternate constructor can take a define list and an optional pathfile to parse.
#define KEYDATA_PATH_SIZE
Definition: misc.h:66
A runlist is used to restrict concurrent exection to a limited set of concurrent sessions,...
Definition: misc.h:709
const char * getString(const char *sym, const char *def=NULL)
Get a string value, with an optional default if missing.
void del(Runable *run)
Remove a runable object from the wait list or notify when it is done running so that the used count c...
void clrValue(const char *sym)
Clear all values associated with a given keyword.
__EXPORT void endKeydata(void)
Definition: misc.h:623
short count
Definition: misc.h:368
bool starting(Runlist *list)
Start the object against a run list.
unsigned used
Definition: misc.h:714
Runlist(unsigned count=1)
Create a new runlist with a specified limit.
substitute functions which may be missing in target platform libc.
const char * getLast(const char *sym)
Get the last (most recently set) value for a given keyword.
unsigned getIndex(char **data, unsigned max)
Get an index array of ALL keywords that are stored by the current keydata object.
Keyval * data
Definition: misc.h:366
Keydata(const char *keypath)
Create a new key data object and use "Load" method to load an initial config file section into it.
const char * value
Definition: misc.h:374
const char * operator[](const char *keyword)
A convient notation for accessing the keydata as an associative array of keyword/value pairs through ...
Definition: misc.h:611
#define KEYDATA_INDEX_SIZE
Definition: misc.h:56
bool add(Runable *run)
Add a runable object to this runlist.
double getDouble(const char *key, double def=0.)
Get a floating value.
void set(unsigned limit)
Set the limit.
virtual void ready(void)=0
Method handler that is invoked when a wait-listed object becomes ready to run.
void load(Define *pairs)
Load default keywords into the current object.
Synchronization and threading services.
This is a generic and portable string class.
Definition: string.h:81
class __EXPORT Runable
Definition: misc.h:74