Public Types | |
typedef DWORD | InstanceCount |
Used to determine the maximum number of instances that an object can have. | |
typedef DWORD | DataLength |
Used to determine the length of an instance name. | |
typedef std::list < Object * > | Objects |
typedef Objects::const_iterator | Iterator |
Public Member Functions | |
CPerformanceDataSchema (const JetByteTools::Core::_tstring &languageId=_T("009")) | |
Creates a performance counter schema object with the specified language id as the default language for messages. Additional languages can be added by calling AddSupportedLanguage() after creating the schema. | |
CPerformanceDataSchema (const CPerformanceDataSchema &rhs) | |
virtual | ~CPerformanceDataSchema () |
CPerformanceDataSchema & | operator= (const CPerformanceDataSchema &rhs) |
JetByteTools::Core::_tstring | GetDefaultLanguage () const |
Returns the default language id for this schema. The default language is the one that is set in the schema's constructor. | |
void | AddSupportedLanguage (const JetByteTools::Core::_tstring &languageId) |
Adds an additional supported language to the schema. Languages must be added to the schema object before message strings in the language can be added to an CPerformanceDataSchema::Object. An exception is thrown if the language is already present in the schema. | |
void | GetSupportedLanguages (JetByteTools::Core::StringVector &languages) const |
Returns a list of the languages supported by the schema. | |
Object & | AddObject (const JetByteTools::Core::_tstring &name, const JetByteTools::Core::_tstring &help, DetailLevel detailLevel) |
Adds a performance data object to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage(). | |
Object & | AddObjectWithInstances (const JetByteTools::Core::_tstring &name, const JetByteTools::Core::_tstring &help, DetailLevel detailLevel, InstanceCount maxInstances, DataLength maxInstanceNameLength) |
Adds a performance data object which supports named instances to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage(). You must specify the maximum number of instances of the object that you will allocate and the maximum length of the name of an instance. These objects should be allocated by calling CPerformanceMonitorCounters::AllocatePerformanceObjectInstance() and providing an instance name. | |
Object & | AddObjectWithInstances (const JetByteTools::Core::_tstring &name, const JetByteTools::Core::_tstring &help, DetailLevel detailLevel, InstanceCount maxInstances) |
Adds a performance data object which supports instances identified by an instance id to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage(). You must specify the maximum number of instances of the object that. These objects should be allocated by calling CPerformanceMonitorCounters::AllocatePerformanceObjectInstance() and providing an instance id. | |
InstanceCount | NumObjects () const |
Returns the number of performance objects that have been defined by the schema. | |
void | ValidateSchema () const |
Throws an exception if the schema is invalid. A valid schema must have at least one performance object and each performance object that it has must have at least one counter defined for it. | |
JetByteTools::Core::_tstring | GetChecksum () const |
Returns a checksum that can be used to compare schemas. This can be written to the registry when the performance counters are installed and then validated when the program runs or the counter dll is loaded by perfmon. This can be used to ensure that the counters that are installed match the counters that the program and counter dll were compiled with. It's quite easy to get these out of synch during development and this functionality helps prevent that. | |
bool | ValidateChecksum (const JetByteTools::Core::_tstring &checksum) const |
Validates that the supplied checksum is correct for this schemas. This can be used to ensure that the counters that are installed match the counters that the program and counter dll were compiled with. It's quite easy to get these out of synch during development and this functionality helps prevent that. | |
DataLength | GetSizeRequired () const |
Returns the total size, in bytes, required in a CPerformanceDataBlock to store the counters that are defined by this schema. This is the size of the object definitions and the size of the data required for the maximum number of instances. | |
DataLength | GetObjectDefinitionSize () const |
Returns the size, in bytes, required in a CPerformanceDataBlock to store just the object definitions. | |
DataLength | GetCounterSize () const |
Returns the size, in bytes, required in a CPerformanceDataBlock to store just the data required for the maximum number of object instances. | |
Iterator | Begin () const |
Returns an iterator to the start of the collection of performance data objects that are defined by this schema. | |
Iterator | End () const |
Returns an iterator to one beyond the end of the collection of performance data objects that are defined by this schema. | |
Classes | |
class | Object |
typedef DWORD InstanceCount |
Used to determine the maximum number of instances that an object can have.
typedef DWORD DataLength |
Used to determine the length of an instance name.
typedef Objects::const_iterator Iterator |
CPerformanceDataSchema | ( | const JetByteTools::Core::_tstring & | languageId = _T("009") |
) | [explicit] |
Creates a performance counter schema object with the specified language id as the default language for messages. Additional languages can be added by calling AddSupportedLanguage() after creating the schema.
CPerformanceDataSchema | ( | const CPerformanceDataSchema & | rhs | ) |
~CPerformanceDataSchema | ( | ) | [virtual] |
CPerformanceDataSchema& operator= | ( | const CPerformanceDataSchema & | rhs | ) |
_tstring GetDefaultLanguage | ( | ) | const |
Returns the default language id for this schema. The default language is the one that is set in the schema's constructor.
void AddSupportedLanguage | ( | const JetByteTools::Core::_tstring & | languageId | ) |
Adds an additional supported language to the schema. Languages must be added to the schema object before message strings in the language can be added to an CPerformanceDataSchema::Object. An exception is thrown if the language is already present in the schema.
void GetSupportedLanguages | ( | JetByteTools::Core::StringVector & | languages | ) | const |
Returns a list of the languages supported by the schema.
Object& AddObject | ( | const JetByteTools::Core::_tstring & | name, | |
const JetByteTools::Core::_tstring & | help, | |||
DetailLevel | detailLevel | |||
) |
Adds a performance data object to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage().
Object& AddObjectWithInstances | ( | const JetByteTools::Core::_tstring & | name, | |
const JetByteTools::Core::_tstring & | help, | |||
DetailLevel | detailLevel, | |||
InstanceCount | maxInstances, | |||
DataLength | maxInstanceNameLength | |||
) |
Adds a performance data object which supports named instances to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage(). You must specify the maximum number of instances of the object that you will allocate and the maximum length of the name of an instance. These objects should be allocated by calling CPerformanceMonitorCounters::AllocatePerformanceObjectInstance() and providing an instance name.
Object& AddObjectWithInstances | ( | const JetByteTools::Core::_tstring & | name, | |
const JetByteTools::Core::_tstring & | help, | |||
DetailLevel | detailLevel, | |||
InstanceCount | maxInstances | |||
) |
Adds a performance data object which supports instances identified by an instance id to the schema. The supplied name and help messages should be in the schema's default language. Versions of these messages in additional languages can be added to the object by calling Object::AddSupportedLanguage(). You must specify the maximum number of instances of the object that. These objects should be allocated by calling CPerformanceMonitorCounters::AllocatePerformanceObjectInstance() and providing an instance id.
CPerformanceDataSchema::InstanceCount NumObjects | ( | ) | const |
Returns the number of performance objects that have been defined by the schema.
void ValidateSchema | ( | ) | const |
Throws an exception if the schema is invalid. A valid schema must have at least one performance object and each performance object that it has must have at least one counter defined for it.
_tstring GetChecksum | ( | ) | const |
Returns a checksum that can be used to compare schemas. This can be written to the registry when the performance counters are installed and then validated when the program runs or the counter dll is loaded by perfmon. This can be used to ensure that the counters that are installed match the counters that the program and counter dll were compiled with. It's quite easy to get these out of synch during development and this functionality helps prevent that.
bool ValidateChecksum | ( | const JetByteTools::Core::_tstring & | checksum | ) | const |
Validates that the supplied checksum is correct for this schemas. This can be used to ensure that the counters that are installed match the counters that the program and counter dll were compiled with. It's quite easy to get these out of synch during development and this functionality helps prevent that.
CPerformanceDataSchema::DataLength GetSizeRequired | ( | ) | const |
Returns the total size, in bytes, required in a CPerformanceDataBlock to store the counters that are defined by this schema. This is the size of the object definitions and the size of the data required for the maximum number of instances.
CPerformanceDataSchema::DataLength GetObjectDefinitionSize | ( | ) | const |
Returns the size, in bytes, required in a CPerformanceDataBlock to store just the object definitions.
CPerformanceDataSchema::DataLength GetCounterSize | ( | ) | const |
Returns the size, in bytes, required in a CPerformanceDataBlock to store just the data required for the maximum number of object instances.
CPerformanceDataSchema::Iterator Begin | ( | ) | const |
Returns an iterator to the start of the collection of performance data objects that are defined by this schema.
CPerformanceDataSchema::Iterator End | ( | ) | const |
Returns an iterator to one beyond the end of the collection of performance data objects that are defined by this schema.