Interface to all data in a DCFG.
More...
#include <dcfg_api.H>
|
virtual bool | read (std::istream &strm, std::string &errMsg, bool readToEof=true)=0 |
| Set internal DCFG data from a C++ istream .
|
|
virtual bool | read (const std::string filename, std::string &errMsg)=0 |
| Open a file for reading and set internal DCFG data from its contents.
|
|
virtual void | write (std::ostream &strm) const =0 |
| Write internal DCFG data to a C++ ostream .
|
|
virtual bool | write (const std::string &filename, std::string &errMsg) const =0 |
| Write internal DCFG data to a file.
|
|
virtual void | clearCounts ()=0 |
| Set all dynamic counts to zero.
|
|
virtual UINT32 | get_process_ids (DCFG_ID_CONTAINER &process_ids) const =0 |
| Get list of process IDs.
|
|
virtual DCFG_PROCESS_CPTR | get_process_info (DCFG_ID process_id) const =0 |
| Get access to data for a process.
|
|
Interface to all data in a DCFG.
This is an interface; use DCFG_DATA::new_dcfg() to create an object that implements the interface.
virtual UINT32 dcfg_api::DCFG_DATA::get_process_ids |
( |
DCFG_ID_CONTAINER & |
process_ids | ) |
const |
|
pure virtual |
Get list of process IDs.
- Returns
- Number of IDs that were added to
process_ids
.
- Parameters
-
[out] | process_ids | Container to which process IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc. |
virtual DCFG_PROCESS_CPTR dcfg_api::DCFG_DATA::get_process_info |
( |
DCFG_ID |
process_id | ) |
const |
|
pure virtual |
Get access to data for a process.
- Returns
- Pointer to interface object for specified process or
NULL
if process_id
is invalid.
- Parameters
-
[in] | process_id | ID of desired process. |
static DCFG_DATA* dcfg_api::DCFG_DATA::new_dcfg |
( |
| ) |
|
|
static |
Create a new DCFG.
This is a factory method to create a new object that implements the DCFG_DATA interface.
- Returns
- Pointer to new object. It can be freed with
delete
.
virtual bool dcfg_api::DCFG_DATA::read |
( |
std::istream & |
strm, |
|
|
std::string & |
errMsg, |
|
|
bool |
readToEof = true |
|
) |
| |
|
pure virtual |
Set internal DCFG data from a C++ istream
.
- Returns
true
on success, false
otherwise (and sets errMsg
).
- Parameters
-
[in] | strm | Stream to read from. Reads one JSON value, which must follow the DCFG JSON format. |
[out] | errMsg | Contains error message upon failure. |
[in] | readToEof | Defines what to do after the JSON value is read. If true , continue reading to end of input stream and fail if any non-whitespace characters are found. If false , stop reading after the the JSON value. |
virtual bool dcfg_api::DCFG_DATA::read |
( |
const std::string |
filename, |
|
|
std::string & |
errMsg |
|
) |
| |
|
pure virtual |
Open a file for reading and set internal DCFG data from its contents.
- Returns
true
on success, false
otherwise (and sets errMsg
).
- Parameters
-
[in] | filename | Name of file to open. Reads one JSON value, which must follow the DCFG JSON format. |
[out] | errMsg | Contains error message upon failure. |
virtual void dcfg_api::DCFG_DATA::write |
( |
std::ostream & |
strm | ) |
const |
|
pure virtual |
Write internal DCFG data to a C++ ostream
.
- Parameters
-
[out] | strm | Stream to write to. Output will conform to the DCFG JSON format. |
virtual bool dcfg_api::DCFG_DATA::write |
( |
const std::string & |
filename, |
|
|
std::string & |
errMsg |
|
) |
| const |
|
pure virtual |
Write internal DCFG data to a file.
- Returns
true
on success, false
otherwise (and sets errMsg
).
- Parameters
-
[in] | filename | Name of file to open. Output will conform to the DCFG JSON format. |
[out] | errMsg | Contains error message upon failure. |
The documentation for this class was generated from the following file: