AgentXcpp  Revision:0.1
Internals Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
agentxcpp::varbind Class Reference

Represents a VarBind according to RFC 2741, section 5.4. More...

#include <varbind.hpp>

Collaboration diagram for agentxcpp::varbind:
[legend]

List of all members.

Public Types

enum  type_t { Null = 5, noSuchObject = 128, noSuchInstance = 129, endOfMibView = 130 }
 These values can be used to create a VarBind. More...

Public Member Functions

 varbind (const oid &, boost::shared_ptr< variable > v)
 Create a VarBind with an oid and a var.
 varbind (const oid &, type_t)
 Create VarBind without var, but with a type.
 varbind (data_t::const_iterator &pos, const data_t::const_iterator &end, bool big_endian=true)
 Construct the object from input stream.
data_t serialize () const
 Serialize the varbind.

Private Attributes

oid name
 The name (OID) of the VarBind.
boost::shared_ptr< variablevar
 The variable inside the varbind.
uint16_t type
 The type of the varbind.

Detailed Description

Represents a VarBind according to RFC 2741, section 5.4.

Definition at line 36 of file varbind.hpp.


Member Enumeration Documentation

These values can be used to create a VarBind.

Enumerator:
Null 
noSuchObject 
noSuchInstance 
endOfMibView 

Definition at line 83 of file varbind.hpp.


Constructor & Destructor Documentation

varbind::varbind ( const oid o,
boost::shared_ptr< variable v 
)

Create a VarBind with an oid and a var.

The variable must be one of the following types:

Definition at line 55 of file varbind.cpp.

References name, type, and var.

varbind::varbind ( const oid o,
type_t  t 
)

Create VarBind without var, but with a type.

Only the constants defined by varbind::type_t are allowed. A wrong type will cause an inval_param exception.

Definition at line 78 of file varbind.cpp.

References endOfMibView, name, noSuchInstance, noSuchObject, Null, and type.

varbind::varbind ( data_t::const_iterator &  pos,
const data_t::const_iterator &  end,
bool  big_endian = true 
)

Construct the object from input stream.

This constructor parses the serialized form of the object. It takes an iterator, starts parsing at the position of the iterator and advances the iterator to the position right behind the object.

The constructor expects valid data from the stream; if parsing fails, parse_error is thrown. In this case, the iterator position is undefined.

Parameters:
posIterator pointing to the current stream position. The iterator is advanced while reading the header.
endIterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer.
big_endianWhether the input stream is in big endian format

Definition at line 98 of file varbind.cpp.

References name, read16(), type, and var.


Member Function Documentation

Serialize the varbind.

This creates the binary representation of the varbind.

Definition at line 33 of file varbind.cpp.

References name, agentxcpp::oid::serialize(), type, and var.


Member Data Documentation

The name (OID) of the VarBind.

Definition at line 42 of file varbind.hpp.

Referenced by serialize(), and varbind().

The type of the varbind.

This field represents the type as described in RFC 2741, section 5.4. The serialize() function will copy it directly into the varbind.

Definition at line 59 of file varbind.hpp.

Referenced by serialize(), and varbind().

boost::shared_ptr<variable> agentxcpp::varbind::var [private]

The variable inside the varbind.

This pointer may be 0 if the varbind has a type without a variable (e.g. "NoSuchObject").

Definition at line 50 of file varbind.hpp.

Referenced by serialize(), and varbind().


The documentation for this class was generated from the following files: