dtn::EndpointID Class Reference

#include <EndpointID.h>

Inheritance diagram for dtn::EndpointID:
dtn::EndpointIDPattern dtn::EndpointIDShim dtn::TcaEndpointID

List of all members.

Public Types

enum  singleton_info_t { UNKNOWN, SINGLETON, MULTINODE }
 

Typedef for the return value possibilities from is_singleton.

More...

Public Member Functions

 EndpointID ()
 Default constructor.
 EndpointID (const oasys::Builder &)
 Constructor for deserialization.
 EndpointID (const std::string &str)
 Construct the endpoint id from the given string.
 EndpointID (const char *str, size_t len)
 Construct the endpoint id from the given string.
 EndpointID (const EndpointID &other)
 Construct the endpoint id from another.
virtual ~EndpointID ()
 Destructor.
bool assign (const EndpointID &other)
 Assign this endpoint ID as a copy of the other.
bool assign (const std::string &str)
 Set the string and validate it.
bool assign (const char *str, size_t len)
 Set the string and validate it.
bool assign (const std::string &scheme, const std::string &ssp)
 Set the string from component pieces and validate it.
bool equals (const EndpointID &other) const
 Simple equality test function.
bool operator== (const EndpointID &other) const
 Operator overload for equality syntactic sugar.
bool operator!= (const EndpointID &other) const
 Operator overload for inequality syntactic sugar.
bool operator< (const EndpointID &other) const
 Operator overload for STL comparison-based data structures (such as a std::map).
int compare (const EndpointID &other) const
 Three way lexographical comparison.
bool assign (const dtn_endpoint_id_t *eid)
 Set the string from the API type dtn_endpoint_id_t.
bool subsume (const EndpointID &other) const
 @ return true if the given EndpointID is contained within this EndpointID; otherwise false.
bool append_service_tag (const char *tag)
 Append the specified service tag (in a scheme-specific manner) to the ssp.
bool append_service_wildcard ()
 Append a wildcard (in a scheme-specific manner) to form a route pattern.
bool remove_service_tag ()
 Reduce EndpointID to routing endpoint.
singleton_info_t is_singleton () const
 Return whether or not this endpoint id is a singleton or a multi-node endpoint.
void copyto (dtn_endpoint_id_t *eid) const
 Copy the endpoint id contents out to the API type dtn_endpoint_id_t.
bool known_scheme () const
 Return an indication of whether or not the scheme is known.
virtual void serialize (oasys::SerializeAction *a)
 Virtual from SerializableObject.

const URIuri () const
const std::string & str () const
const std::string scheme_str () const
const std::string ssp () const
Schemescheme () const
bool valid () const
bool is_pattern () const
const char * c_str () const
const char * data () const
size_t length () const

Static Public Member Functions

static const EndpointIDNULL_EID ()
 Return the special endpoint id used for the null endpoint, namely "dtn:none".

Static Public Attributes

static singleton_info_t is_singleton_default_ = EndpointID::MULTINODE
 Default setting for endpoint ids in unknown schemes.
static bool glob_unknown_schemes_ = true
 Bit to control how to match unknown schemes.
static const size_t MAX_EID_PART_LENGTH = 1023
 The scheme and SSP parts each must not exceed this length.

Protected Member Functions

bool validate ()
 Extract and look up the scheme and ssp.

Protected Attributes

URI uri_
Schemescheme_
bool valid_
bool is_pattern_

Detailed Description

Definition at line 35 of file EndpointID.h.


Member Enumeration Documentation

Typedef for the return value possibilities from is_singleton.

Enumerator:
UNKNOWN 
SINGLETON 
MULTINODE 

Definition at line 206 of file EndpointID.h.


Constructor & Destructor Documentation

dtn::EndpointID::EndpointID (  )  [inline]

Default constructor.

Definition at line 40 of file EndpointID.h.

dtn::EndpointID::EndpointID ( const oasys::Builder &   )  [inline]

Constructor for deserialization.

Definition at line 45 of file EndpointID.h.

dtn::EndpointID::EndpointID ( const std::string &  str  )  [inline]

Construct the endpoint id from the given string.

Definition at line 51 of file EndpointID.h.

References validate().

dtn::EndpointID::EndpointID ( const char *  str,
size_t  len 
) [inline]

Construct the endpoint id from the given string.

Definition at line 60 of file EndpointID.h.

References uri_, and validate().

dtn::EndpointID::EndpointID ( const EndpointID other  )  [inline]

Construct the endpoint id from another.

Definition at line 69 of file EndpointID.h.

References assign().

virtual dtn::EndpointID::~EndpointID (  )  [inline, virtual]

Destructor.

Definition at line 79 of file EndpointID.h.


Member Function Documentation

bool dtn::EndpointID::append_service_tag ( const char *  tag  ) 

Append the specified service tag (in a scheme-specific manner) to the ssp.

Returns:
true if successful, false if the scheme doesn't support service tags

Definition at line 80 of file EndpointID.cc.

References dtn::Scheme::append_service_tag(), log_err_p, scheme_, and uri_.

Referenced by dtn::APIClient::handle_local_eid(), dtn::DTLSRRouter::initialize(), and dtn::ProphetBundleCore::prophet_id().

bool dtn::EndpointID::append_service_wildcard (  ) 

Append a wildcard (in a scheme-specific manner) to form a route pattern.

Returns:
true if successful, false if the scheme doesn't support wildcards

Definition at line 105 of file EndpointID.cc.

References dtn::Scheme::append_service_wildcard(), log_err_p, scheme_, and uri_.

Referenced by dtn::ProphetBundleCore::get_route_pattern().

bool dtn::EndpointID::assign ( const dtn_endpoint_id_t eid  ) 

Set the string from the API type dtn_endpoint_id_t.

Returns:
true if the string is a valid id, false if not.

Definition at line 171 of file EndpointID.cc.

References dtn_endpoint_id_t::uri, uri_, and validate().

bool dtn::EndpointID::assign ( const std::string &  scheme,
const std::string &  ssp 
) [inline]

Set the string from component pieces and validate it.

Returns:
true if the string is a valid id, false if not.

Definition at line 117 of file EndpointID.h.

References uri_, and validate().

bool dtn::EndpointID::assign ( const char *  str,
size_t  len 
) [inline]

Set the string and validate it.

Returns:
true if the string is a valid id, false if not.

Definition at line 107 of file EndpointID.h.

References uri_, and validate().

bool dtn::EndpointID::assign ( const std::string &  str  )  [inline]

Set the string and validate it.

Returns:
true if the string is a valid id, false if not.

Definition at line 97 of file EndpointID.h.

References uri_, and validate().

bool dtn::EndpointID::assign ( const EndpointID other  )  [inline]
const char* dtn::EndpointID::c_str (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 264 of file EndpointID.h.

References uri_.

Referenced by dtn::RegistrationTable::add(), dtn::ForwardingLog::add_entry(), dtn::TableBasedRouter::add_subscriber(), dtn::CustodySignal::create_custody_signal(), dtn::RouteTable::del_entry(), dtnsim::SimRegistration::deliver_bundle(), dtn::APIRegistration::deliver_bundle(), dtn::AdminRegistration::deliver_bundle(), dtn::SessionTable::dump(), dtn::ForwardingLog::dump(), dtn::Dictionary::extract_eid(), dtn::TableBasedRouter::find_session_upstream(), dtn::Subscriber::format(), dtn::EndpointIDShim::format(), dtn::Bundle::format(), dtn::IPAnnounce::format_advertisement(), dtn::Bundle::format_verbose(), dtn::TcaRouter::fwd_to_all(), dtn::TcaRouter::fwd_to_matching_r(), dtn::ProphetStore::get(), dtn::FragmentManager::get_hash_key(), dtn::ProphetBundleCore::get_link(), dtn::RouteTable::get_matching(), dtn::RegistrationTable::get_matching(), dtn::RouteTable::get_matching_helper(), dtn::BundleDaemon::handle_bundle_delete(), dtn::DTLSRRouter::handle_bundle_expired(), dtn::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::BundleDaemon::handle_custody_signal(), dtn::DTLSRRouter::handle_lsa(), dtn::TableBasedRouter::handle_session_bundle(), dtn::APIClient::handle_session_update(), dtn::TcaRouter::handle_tca_unbound_bundle(), dtn::DTLSRRouter::initialize(), is_singleton(), dtn::log_bundle(), dtnsim::SimLog::log_entry(), dtn::EndpointIDPattern::match(), dtn::TcaRouter::on_coa_transmitted(), dtn::TcaRouter::post_bundle(), dtnsim::TrAgent::send_bundle(), dtn::ProphetNode::serialize(), dtn::Session::Session(), dtn::TableBasedRouter::subscribe_to_session(), dtn::TcaRouter::TcaRouter(), dtn::TableBasedRouter::tcl_dump_state(), dtn::TclRegistration::TclRegistration(), dtn::RegistrationTable::update(), and dtn::Bundle::validate().

int dtn::EndpointID::compare ( const EndpointID other  )  const [inline]

Three way lexographical comparison.

Definition at line 159 of file EndpointID.h.

References uri_.

void dtn::EndpointID::copyto ( dtn_endpoint_id_t eid  )  const

Copy the endpoint id contents out to the API type dtn_endpoint_id_t.

Definition at line 179 of file EndpointID.cc.

References ASSERT, DTN_MAX_ENDPOINT_ID, dtn_endpoint_id_t::uri, and uri_.

Referenced by dtn::APIClient::handle_local_eid(), dtn::APIClient::handle_recv(), and dtn::APIClient::handle_session_update().

const char* dtn::EndpointID::data (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 265 of file EndpointID.h.

References uri_.

Referenced by dtn::StreamConvergenceLayer::Connection::initiate_contact().

bool dtn::EndpointID::equals ( const EndpointID other  )  const [inline]
bool dtn::EndpointID::is_pattern (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 263 of file EndpointID.h.

References is_pattern_.

EndpointID::singleton_info_t dtn::EndpointID::is_singleton (  )  const

Return whether or not this endpoint id is a singleton or a multi-node endpoint.

Definition at line 154 of file EndpointID.cc.

References c_str(), dtn::Scheme::is_singleton(), is_singleton_default_, known_scheme(), MULTINODE, scheme_, scheme_str(), SINGLETON, and uri_.

bool dtn::EndpointID::known_scheme (  )  const [inline]

Return an indication of whether or not the scheme is known.

Definition at line 233 of file EndpointID.h.

References scheme_.

Referenced by is_singleton(), dtn::TCAScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().

size_t dtn::EndpointID::length (  )  const [inline]
const EndpointID & dtn::EndpointID::NULL_EID (  )  [inline, static]
bool dtn::EndpointID::operator!= ( const EndpointID other  )  const [inline]

Operator overload for inequality syntactic sugar.

Definition at line 142 of file EndpointID.h.

References uri_.

bool dtn::EndpointID::operator< ( const EndpointID other  )  const [inline]

Operator overload for STL comparison-based data structures (such as a std::map).

Definition at line 151 of file EndpointID.h.

References uri_.

bool dtn::EndpointID::operator== ( const EndpointID other  )  const [inline]

Operator overload for equality syntactic sugar.

Definition at line 134 of file EndpointID.h.

References uri_.

bool dtn::EndpointID::remove_service_tag (  ) 

Reduce EndpointID to routing endpoint.

Returns:
true if eid is set to node_id, false otherwise

Definition at line 130 of file EndpointID.cc.

References log_err_p, dtn::Scheme::remove_service_tag(), scheme_, and uri_.

Referenced by dtn::ProphetBundleCore::get_route().

Scheme* dtn::EndpointID::scheme (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 261 of file EndpointID.h.

References scheme_.

Referenced by dtn::WildcardScheme::match(), dtn::TCAScheme::match(), dtn::StringScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().

const std::string dtn::EndpointID::scheme_str (  )  const [inline]
void dtn::EndpointID::serialize ( oasys::SerializeAction *  a  )  [virtual]

Virtual from SerializableObject.

Definition at line 187 of file EndpointID.cc.

References uri_, and validate().

const std::string dtn::EndpointID::ssp (  )  const [inline]
const std::string& dtn::EndpointID::str (  )  const [inline]
bool dtn::EndpointID::subsume ( const EndpointID other  )  const [inline]

@ return true if the given EndpointID is contained within this EndpointID; otherwise false.

Definition at line 175 of file EndpointID.h.

References uri_.

Referenced by dtn::DTLSRRouter::handle_registration_added().

const URI& dtn::EndpointID::uri (  )  const [inline]

Accessors and wrappers around the various fields.

Definition at line 257 of file EndpointID.h.

References uri_.

Referenced by dtn::DTLSRRouter::handle_lsa(), dtn::TCAScheme::match(), dtn::SessionScheme::match(), dtn::EndpointIDPattern::match(), and dtn::DTNScheme::match().

bool dtn::EndpointID::valid (  )  const [inline]
bool dtn::EndpointID::validate (  )  [protected]

Extract and look up the scheme and ssp.

Returns:
true if the string is a valid endpoint id, false if not.

Definition at line 44 of file EndpointID.cc.

References is_pattern_, length(), dtn::log, log_err_p, MAX_EID_PART_LENGTH, scheme_, scheme_str(), ssp(), uri_, valid_, and dtn::Scheme::validate().

Referenced by assign(), EndpointID(), dtn::EndpointIDPattern::EndpointIDPattern(), and serialize().


Member Data Documentation

Bit to control how to match unknown schemes.

Definition at line 222 of file EndpointID.h.

Referenced by dtn::EndpointIDPattern::match(), and dtn::ParamCommand::ParamCommand().

Default setting for endpoint ids in unknown schemes.

Definition at line 217 of file EndpointID.h.

Referenced by dtn::APIClient::handle_send(), is_singleton(), and dtn::ParamCommand::ParamCommand().

const size_t dtn::EndpointID::MAX_EID_PART_LENGTH = 1023 [static]

The scheme and SSP parts each must not exceed this length.

Definition at line 247 of file EndpointID.h.

Referenced by validate().

Definition at line 281 of file EndpointID.h.

Referenced by assign(), dtn::TcaEndpointID::parse(), valid(), and validate().


The documentation for this class was generated from the following files:
Generated on Sun Nov 21 11:41:07 2010 for DTN Reference Implementation by  doxygen 1.6.3