Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

GenAddress Class Reference

#include <address.h>

Inheritance diagram for GenAddress:

[legend]
Collaboration diagram for GenAddress:
[legend]
List of all members.

Public Member Functions

 GenAddress ()
 Construct an empty invalid generic address object.

 GenAddress (const char *addr, const Address::addr_type use_type=Address::type_invalid)
 Construct a generic address from a string.

 GenAddress (const Address &addr)
 Construct a generic address from an Address object.

 GenAddress (const GenAddress &addr)
 Construct a generic address from another generic address object.

 ~GenAddress ()
 Destructor, free memory.

SmiUINT32 get_syntax () const
 Return the syntax.

virtual int get_asn1_length () const
 Return the space needed for serialization.

SnmpSyntaxclone () const
 Clone this object.

GenAddressoperator= (const GenAddress &addr)
 Overloaded assignment operator for a GenAddress.

GenAddressoperator= (const Address &addr)
 Overloaded assignment operator for a Address.

SnmpSyntaxoperator= (const SnmpSyntax &val)
 Map other SnmpSyntax objects to GenAddress.

virtual const char * get_printable () const
 Get a printable ASCII value of the address.

virtual operator const char * () const
 Overloaded operator for streaming output.

virtual int get_length () const
 Get the length of the binary address (accessible through operator[]).

void clear ()
 Reset the object.

virtual addr_type get_type () const
 Return the type of the address.

const IpAddresscast_ipaddress () const
 Access the protected address.

const UdpAddresscast_udpaddress () const
 Access the protected address.


Protected Member Functions

virtual bool parse_address (const char *addr)
virtual bool parse_address (const char *addr, const Address::addr_type use_type)
virtual void format_output () const
virtual bool is_gen_address () const
 Is this a GenAddress object.


Protected Attributes

Addressaddress
char output_buffer [1]

Constructor & Destructor Documentation

GenAddress::GenAddress  ) 
 

Construct an empty invalid generic address object.

GenAddress::GenAddress const char *  addr,
const Address::addr_type  use_type = Address::type_invalid
 

Construct a generic address from a string.

To optimize the speed of the parsing method, use_type can be used to indicate that the address string is of the specified type.

Parameters:
addr - address string
use_type - if this value is set, the input string is only parsed for the given type

GenAddress::GenAddress const Address addr  ) 
 

Construct a generic address from an Address object.

Parameters:
addr - Any address object

GenAddress::GenAddress const GenAddress addr  ) 
 

Construct a generic address from another generic address object.

Parameters:
addr - Generic address object to copy

GenAddress::~GenAddress  )  [inline]
 

Destructor, free memory.

Definition at line 983 of file address.h.


Member Function Documentation

const IpAddress& GenAddress::cast_ipaddress  )  const [inline]
 

Access the protected address.

The caller must make sure that this GenAddress object ist valid() and is of the right type (get_type()).

Definition at line 1064 of file address.h.

const UdpAddress& GenAddress::cast_udpaddress  )  const [inline]
 

Access the protected address.

The caller must make sure that this GenAddress object ist valid() and is of the right type (get_type()).

Definition at line 1071 of file address.h.

void GenAddress::clear  )  [inline, virtual]
 

Reset the object.

Reimplemented from Address.

Definition at line 1048 of file address.h.

SnmpSyntax* GenAddress::clone  )  const [inline, virtual]
 

Clone this object.

Returns:
Pointer to the newly created object (allocated through new).

Implements SnmpSyntax.

Definition at line 1006 of file address.h.

virtual void GenAddress::format_output  )  const [inline, protected, virtual]
 

Implements Address.

Definition at line 1112 of file address.h.

virtual int GenAddress::get_asn1_length  )  const [inline, virtual]
 

Return the space needed for serialization.

Implements Address.

Definition at line 998 of file address.h.

virtual int GenAddress::get_length  )  const [inline, virtual]
 

Get the length of the binary address (accessible through operator[]).

Implements Address.

Definition at line 1042 of file address.h.

virtual const char* GenAddress::get_printable  )  const [inline, virtual]
 

Get a printable ASCII value of the address.

Returns:
String containing the numerical address

Implements SnmpSyntax.

Definition at line 1028 of file address.h.

SmiUINT32 GenAddress::get_syntax  )  const [inline, virtual]
 

Return the syntax.

Returns:
This method returns sNMP_SYNTAX_IPADDR, sNMP_SYNTAX_OCTETS or sNMP_SYNTAX_NULL if the generic address does not have an address object.

Implements SnmpSyntax.

Definition at line 992 of file address.h.

References SmiUINT32, and sNMP_SYNTAX_NULL.

virtual addr_type GenAddress::get_type  )  const [inline, virtual]
 

Return the type of the address.

See also:
Address::addr_type
Returns:
Type of the contained address object or Address::type_invalid if it is not valid().

Implements Address.

Definition at line 1056 of file address.h.

virtual bool GenAddress::is_gen_address  )  const [inline, protected, virtual]
 

Is this a GenAddress object.

Reimplemented from Address.

Definition at line 1117 of file address.h.

virtual GenAddress::operator const char *  )  const [inline, virtual]
 

Overloaded operator for streaming output.

Returns:
String containing the numerical address

Implements Address.

Definition at line 1036 of file address.h.

SnmpSyntax& GenAddress::operator= const SnmpSyntax val  )  [virtual]
 

Map other SnmpSyntax objects to GenAddress.

Implements Address.

GenAddress& GenAddress::operator= const Address addr  ) 
 

Overloaded assignment operator for a Address.

GenAddress& GenAddress::operator= const GenAddress addr  ) 
 

Overloaded assignment operator for a GenAddress.

virtual bool GenAddress::parse_address const char *  addr,
const Address::addr_type  use_type
[protected, virtual]
 

virtual bool GenAddress::parse_address const char *  addr  )  [inline, protected, virtual]
 

Implements Address.

Definition at line 1105 of file address.h.

References Address::type_invalid.


Member Data Documentation

Address* GenAddress::address [protected]
 

Definition at line 1101 of file address.h.

char GenAddress::output_buffer[1] [protected]
 

Definition at line 1102 of file address.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 22:42:18 2005 for SNMP++ by doxygen 1.3.2