AgentXcpp  Version:0.3
API Documentation
 All Classes Functions Variables Enumerations Enumerator Friends Pages
agentxcpp::AbstractVariable Class Referenceabstract

Base class for SNMP variables. More...

#include <AbstractVariable.hpp>

Inheritance diagram for agentxcpp::AbstractVariable:
[legend]

Public Types

enum  testset_result_t {
  noError = 0, genErr = 5, noAccess = 6, wrongType = 7,
  wrongLength = 8, wrongValue = 10, noCreation = 11, inconsistentValue = 12,
  resourceUnavailable = 13, notWritable = 17, inconsistentName = 18
}
 Result type for the TestSet validation. More...
 

Public Member Functions

virtual ~AbstractVariable ()
 Virtual destructor. More...
 
virtual Oid toOid () const =0
 Convert an INDEX variable to an Oid part. More...
 

Detailed Description

Base class for SNMP variables.

This class is the base class for SNMP variable implementations. It provides the interface which is used by agentXcpp (namely by the MasterProxy class) to perform operations on variables. An overiew on variable handling in agentxcpp is given in The Variable Objects.

Note
This class should never be inherited by non-agentXcpp code.

Member Enumeration Documentation

Result type for the TestSet validation.

A value of this type is returned during a TestSet operation according to RFC 2741, 7.2.4.1. "Subagent Processing of the agentx-TestSet-PDU".

Note
The value 'wrongEncoding' is not used within the agentXcpp implementation and is therefore not part of this enumeration.

The numeric values are given in RFC 2741, 7.2.4.1. "Subagent Processing of the agentx-TestSet-PDU".

Enumerator
noError 

Validation succeeded.

genErr 

The variable could not be set, and there is no other enumeration value to express the reason.

noAccess 

Access denied (i.e. the object is read-only).

wrongType 

The object cannot be set to the requested type because it has the wrong type (e.g. an OctetString variable cannot be set to an Integer value).

wrongLength 

The requested new value has the wrong length. E.g. an OctetString variable may be restricted to 8 characters, but the requested new string has 15 characters.

wrongValue 

The requested value could under no circumstances be assigned to the variable (although the variable is read-write). For example, certain values may be disallowed for a specific Integer variable.

noCreation 

The variable does not exist and could not ever be created.

inconsistentValue 

The requested value could under other circumstances be held by the variable, but is presently inconsistent or otherwise unable to be assigned to the variable.

resourceUnavailable 

A resource which is required to perform the actual Set operation is unavailable. A Set operation would fail because of this reason.

notWritable 

The object doesn't exist and cannot be created on-the-fly, or the variable exists but cannot be modified.

Note
Use noAccess for read-only variables.
inconsistentName 

The variable does not exist and can not be created under the present circumstances (even though it could be created under other circumstances).

Constructor & Destructor Documentation

virtual agentxcpp::AbstractVariable::~AbstractVariable ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual Oid agentxcpp::AbstractVariable::toOid ( ) const
pure virtual

Convert an INDEX variable to an Oid part.

If an SNMP variable is used as INDEX within a table, then its value is used as part of the Oid for that table entry. Therefore, such variables must be convertible to Oid's. This method provides this conversion.

Not all variable types are allowed to be used as INDEX and are therefore not convertible to Oid. For variables which are not convertible, this method shall return the null Oid.

Returns
The Oid representing the variables value, or the null Oid if the variable don't support such conversion.
Exceptions
Thismethod shall not throw.

Implemented in agentxcpp::Gauge32Variable, agentxcpp::OpaqueVariable, agentxcpp::TimeTicksVariable, agentxcpp::Counter64Variable, agentxcpp::Counter32Variable, agentxcpp::IpAddressVariable, agentxcpp::IntegerVariable, agentxcpp::OidVariable, and agentxcpp::OctetStringVariable.