// Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved /*----------------------------------------------------------------- Filename: value.hpp Purpose : To specify the classes of various Prov values and instance identifiers. These classes represent the different types of values for variables that may populate a MIB. Written By: B.Rajeev -----------------------------------------------------------------*/ #ifndef __VALUE__ #define __VALUE__ /*----------------------------------------------------------------- General Overview: A variable instance refers to a MIB object, e.g. ‘1.3.6.1.2.1.1.1.0’ or ‘1.3.6.1.2.1.2.1.2.1’. The instance is encoded as an Prov object identifier and is represented by the class ‘ProvObjectIdentifier’. The classes derived from ProvValue represent the encoding of the information stored within the MIB object. The ‘value’ is encoded as an implementation of the abstract class ‘ProvValue’. The Prov class library implements the following derivations of ‘ProvValue’ which refer to Prov BER encoded types. ProvNull ProvInteger ProvCounter32 ProvCounter64 ProvGauge ProvTimeTicks ProvIPAddress ProvNetworkAddress ProvBitString ProvOctetString ProvOpaque ProvObjectIdentifier All the implemented classes provide (in addition to others) - 1. Constructors to initialize using relevant values or another instance of the same class. 2. GetValue, SetValue methods for obtaining and setting relevant values. 3. "=" operator to over-ride the default assignment operator and an Equivalent method to check for equivalence between two instances of the same (derived) class 4. Copy methods for obtaining a copy of a specified instance of the class. note of caution: ---------------- Some of the GetValue functions return pointers to dynamically allocated data. Users of the class must make copies of the returned values and must not rely on the integrity of this pointer or values obtained through it in future (because of SetValue methods, or destruction of corresponding ProvValue class) -----------------------------------------------------------------*/ #include #include // Abstract class at the root of all Prov Values // maximum length of decimal dot notation addresses #define MAX_ADDRESS_LEN 100 // end of string character #define EOS '\0' #define MIN(a,b) ((a<=b)?a:b) #define BETWEEN(i, min, max) ( ((i>=min)&&(i