oasys::Opt Class Reference

#include <Options.h>

Inheritance diagram for oasys::Opt:

dtn::APIEndpointIDOpt dtn::EndpointIDOpt oasys::BdAddrOpt oasys::BoolOpt oasys::CharBufOpt oasys::DoubleOpt oasys::EnumOpt oasys::InAddrOpt oasys::IntOpt oasys::StringOpt oasys::UInt16Opt oasys::UInt8Opt oasys::UIntOpt List of all members.

Detailed Description

Base class for options.

These can be used either with the Getopt class for parsing argv-style declarations or with the OptParser class for parsing argument strings or arrays of strings.

Definition at line 53 of file Options.h.

Public Member Functions

virtual ~Opt ()

Protected Member Functions

 Opt (char shortopt, const char *longopt, void *valp, bool *setp, bool needval, const char *valdesc, const char *desc)
 Private constructor.
virtual int set (const char *val, size_t len)=0
 Virtual callback to set the option to the given string value.

Protected Attributes

char shortopt_
const char * longopt_
void * valp_
boolsetp_
bool needval_
const char * valdesc_
const char * desc_
Optnext_

Friends

class Getopt
class OptParser


Constructor & Destructor Documentation

oasys::Opt::~Opt (  )  [virtual]

Definition at line 71 of file Options.cc.

oasys::Opt::Opt ( char  shortopt,
const char *  longopt,
void *  valp,
bool setp,
bool  needval,
const char *  valdesc,
const char *  desc 
) [protected]

Private constructor.

Definition at line 54 of file Options.cc.


Member Function Documentation

virtual int oasys::Opt::set ( const char *  val,
size_t  len 
) [protected, pure virtual]

Virtual callback to set the option to the given string value.

Implemented in dtn::APIEndpointIDOpt, oasys::BoolOpt, oasys::IntOpt, oasys::UIntOpt, oasys::UInt16Opt, oasys::UInt8Opt, oasys::DoubleOpt, oasys::StringOpt, oasys::CharBufOpt, oasys::InAddrOpt, oasys::EnumOpt, oasys::BdAddrOpt, and dtn::EndpointIDOpt.

Referenced by oasys::OptParser::parse_opt().


Friends And Related Function Documentation

friend class Getopt [friend]

Definition at line 54 of file Options.h.

friend class OptParser [friend]

Definition at line 55 of file Options.h.


Member Data Documentation

char oasys::Opt::shortopt_ [protected]

Definition at line 73 of file Options.h.

Referenced by oasys::Getopt::addopt(), and oasys::Getopt::getopt().

const char* oasys::Opt::longopt_ [protected]

Definition at line 74 of file Options.h.

Referenced by oasys::OptParser::parse_opt().

void* oasys::Opt::valp_ [protected]

Definition at line 75 of file Options.h.

Referenced by oasys::BdAddrOpt::set(), oasys::EnumOpt::set(), oasys::InAddrOpt::set(), oasys::CharBufOpt::set(), oasys::StringOpt::set(), oasys::DoubleOpt::set(), oasys::UInt8Opt::set(), oasys::UInt16Opt::set(), oasys::UIntOpt::set(), oasys::IntOpt::set(), oasys::BoolOpt::set(), dtn::EndpointIDOpt::set(), and dtn::APIEndpointIDOpt::set().

bool* oasys::Opt::setp_ [protected]

Definition at line 76 of file Options.h.

Referenced by oasys::BdAddrOpt::set(), oasys::EnumOpt::set(), oasys::InAddrOpt::set(), oasys::CharBufOpt::set(), oasys::StringOpt::set(), oasys::DoubleOpt::set(), oasys::UInt8Opt::set(), oasys::UInt16Opt::set(), oasys::UIntOpt::set(), oasys::IntOpt::set(), oasys::BoolOpt::set(), dtn::EndpointIDOpt::set(), and dtn::APIEndpointIDOpt::set().

bool oasys::Opt::needval_ [protected]

Definition at line 77 of file Options.h.

Referenced by oasys::Getopt::getopt(), and oasys::OptParser::parse_opt().

const char* oasys::Opt::valdesc_ [protected]

Definition at line 78 of file Options.h.

const char* oasys::Opt::desc_ [protected]

Definition at line 79 of file Options.h.

Opt* oasys::Opt::next_ [protected]

Definition at line 80 of file Options.h.


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:08 2006 for DTN Reference Implementation by  doxygen 1.5.1