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::UInt64Opt 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 38 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.
virtual void get (StringBuffer *buf)=0
 Virtual callback to get a string version of the current value.

Protected Attributes

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

Friends

class Getopt
class OptParser
class TclCommand

Constructor & Destructor Documentation

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

Definition at line 49 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 33 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::UInt64Opt, oasys::UInt16Opt, oasys::UInt8Opt, oasys::DoubleOpt, oasys::StringOpt, oasys::CharBufOpt, oasys::InAddrOpt, oasys::EnumOpt, oasys::BdAddrOpt, and dtn::EndpointIDOpt.

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

virtual void oasys::Opt::get ( StringBuffer buf  )  [protected, pure virtual]

Virtual callback to get a string version of the current value.

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


Friends And Related Function Documentation

friend class Getopt [friend]

Definition at line 39 of file Options.h.

friend class OptParser [friend]

Definition at line 40 of file Options.h.

friend class TclCommand [friend]

Definition at line 41 of file Options.h.


Member Data Documentation

char oasys::Opt::shortopt_ [protected]

Definition at line 64 of file Options.h.

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

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

Definition at line 65 of file Options.h.

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

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

Definition at line 66 of file Options.h.

Referenced by oasys::BdAddrOpt::get(), oasys::EnumOpt::get(), oasys::InAddrOpt::get(), oasys::CharBufOpt::get(), oasys::StringOpt::get(), oasys::DoubleOpt::get(), oasys::UInt8Opt::get(), oasys::UInt16Opt::get(), oasys::UInt64Opt::get(), oasys::UIntOpt::get(), oasys::IntOpt::get(), oasys::BoolOpt::get(), dtn::EndpointIDOpt::get(), dtn::APIEndpointIDOpt::get(), 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::UInt64Opt::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 67 of file Options.h.

Referenced by oasys::Getopt::getopt(), 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::UInt64Opt::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 68 of file Options.h.

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

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

Definition at line 69 of file Options.h.

Referenced by oasys::Getopt::usage().

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

Definition at line 70 of file Options.h.

Referenced by oasys::Getopt::usage().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:55 2007 for DTN Reference Implementation by  doxygen 1.5.3