ariba::addressing::endpoint_set Class Reference

#include <source/ariba/utility/addressing/endpoint_set.hpp>

Collaboration diagram for ariba::addressing::endpoint_set:

Collaboration graph
[legend]

List of all members.

Public Types

enum  layers {
  Layer1 = 1, Layer2 = 2, Layer3 = 4, Layer4 = 8,
  Layer5 = 16, Layer6 = 32, Layer7 = 64, Layer8 = 128,
  AllLayers = ~0, Layer1_3 = Layer1|Layer2|Layer3, Layer1_4 = Layer1|Layer2|Layer3|Layer4
}
typedef boost::mutex::scoped_lock scoped_lock

Public Member Functions

 endpoint_set ()
 endpoint_set (const endpoint_set &copy)
 endpoint_set (const std::string &str)
 endpoint_set (const uint8_t *bytes, size_t size)
void add (const address_v *address, int layers=AllLayers)
 adds an address or endpoint to this set
void add (const endpoint_set &eps, int layers=AllLayers)
 adds addresses from another endpoint set
void remove (const address_vf address)
 removes an address or endpoint from this set
bool disjoint_to (const endpoint_set &set) const
bool intersects_with (const endpoint_set &set) const
bool is_subset_of (const endpoint_set &set) const
bool is_bytes_size_static () const
 returns true, if this address has a fixed size in bytes
size_t to_bytes_size () const
 returns the number of bytes used for serialization of this address
void to_bytes (uint8_t *bytes) const
 converts this address to a binary representation
bool assign (const uint8_t *bytes, size_t size)
 Assigns an address using a bunch of bytes.
std::string to_string () const
 generates a string out of this endpoint-set
void assign (const std::string &str)
 assigns an endpoint-set out of a string
endpoint_setoperator= (const endpoint_set &rhs)
bool operator== (const endpoint_set &rhs) const
 checks wheter the two endpoint sets are identical
bool operator!= (const endpoint_set &rhs) const

Public Attributes

unordered_set< mac_addressbluetooth
unordered_set< ip_addressip
unordered_set< tcp_port_addresstcp
unordered_set
< rfcomm_channel_address
rfcomm
boost::mutex io_mutex

Private Member Functions

template<uint8_t type, class V >
size_t to_bytes_dynamic (const unordered_set< V > &set, uint8_t *bytes) const
template<class V >
void from_bytes_dynamic (unordered_set< V > &set, const uint8_t *bytes, uint8_t size)
template<uint8_t type, class V >
size_t to_bytes_fixed (const unordered_set< V > &set, uint8_t *bytes) const
template<class V >
void from_bytes_fixed (unordered_set< V > &set, const uint8_t *bytes, uint8_t size)
template<class V >
std::string to_string_set (const unordered_set< V > &set, const std::string &type) const
template<class V >
size_t from_string_set (unordered_set< V > &set, string::size_type pos, const std::string &str)

Static Private Member Functions

static void trim (string &str)
static string::size_type skip (const char *chars, string::size_type pos, const std::string &str)


Detailed Description

This end-point set shelters known addresses of a device. Transport protocols use this class to address devices.

Example of a string representation: "tcp{500|501};ip{10.11.12.13};bluetooth{01:02:03:04:05:06};rfcomm{1234}" Inside a address type specification, addresses are separated by a bar (|).

Author:
Sebastian Mies <mies@tm.uka.de>

Definition at line 27 of file endpoint_set.hpp.


Member Typedef Documentation

typedef boost::mutex::scoped_lock ariba::addressing::endpoint_set::scoped_lock

Definition at line 41 of file endpoint_set.hpp.


Member Enumeration Documentation

Enumerator:
Layer1 
Layer2 
Layer3 
Layer4 
Layer5 
Layer6 
Layer7 
Layer8 
AllLayers 
Layer1_3 
Layer1_4 

Definition at line 161 of file endpoint_set.hpp.


Constructor & Destructor Documentation

ariba::addressing::endpoint_set::endpoint_set (  )  [inline]

Definition at line 168 of file endpoint_set.hpp.

ariba::addressing::endpoint_set::endpoint_set ( const endpoint_set copy  )  [inline]

Definition at line 172 of file endpoint_set.hpp.

ariba::addressing::endpoint_set::endpoint_set ( const std::string &  str  )  [inline]

Definition at line 176 of file endpoint_set.hpp.

References assign().

ariba::addressing::endpoint_set::endpoint_set ( const uint8_t *  bytes,
size_t  size 
) [inline]

Definition at line 180 of file endpoint_set.hpp.

References assign().


Member Function Documentation

void ariba::addressing::endpoint_set::add ( const endpoint_set eps,
int  layers = AllLayers 
) [inline]

adds addresses from another endpoint set

Definition at line 208 of file endpoint_set.hpp.

References bluetooth, io_mutex, ip, Layer2, Layer3, Layer4, rfcomm, and tcp.

void ariba::addressing::endpoint_set::add ( const address_v address,
int  layers = AllLayers 
) [inline]

void ariba::addressing::endpoint_set::assign ( const std::string &  str  )  [inline]

assigns an endpoint-set out of a string

Definition at line 368 of file endpoint_set.hpp.

References bluetooth, io_mutex, ip, rfcomm, skip(), tcp, and trim().

bool ariba::addressing::endpoint_set::assign ( const uint8_t *  bytes,
size_t  size 
) [inline]

Assigns an address using a bunch of bytes.

Definition at line 314 of file endpoint_set.hpp.

References bluetooth, io_mutex, ip, rfcomm, and tcp.

Referenced by endpoint_set(), and ariba::communication::BaseCommunication::setEndpoints().

bool ariba::addressing::endpoint_set::disjoint_to ( const endpoint_set set  )  const [inline]

checks whether two end-points are disjoint (only check lower level addresses)

Definition at line 249 of file endpoint_set.hpp.

References bluetooth, io_mutex, and ip.

Referenced by intersects_with().

template<class V >
void ariba::addressing::endpoint_set::from_bytes_dynamic ( unordered_set< V > &  set,
const uint8_t *  bytes,
uint8_t  size 
) [inline, private]

Definition at line 64 of file endpoint_set.hpp.

References internal::V().

template<class V >
void ariba::addressing::endpoint_set::from_bytes_fixed ( unordered_set< V > &  set,
const uint8_t *  bytes,
uint8_t  size 
) [inline, private]

Definition at line 89 of file endpoint_set.hpp.

References internal::V().

template<class V >
size_t ariba::addressing::endpoint_set::from_string_set ( unordered_set< V > &  set,
string::size_type  pos,
const std::string &  str 
) [inline, private]

Definition at line 140 of file endpoint_set.hpp.

References skip(), trim(), and internal::V().

bool ariba::addressing::endpoint_set::intersects_with ( const endpoint_set set  )  const [inline]

Definition at line 258 of file endpoint_set.hpp.

References disjoint_to().

bool ariba::addressing::endpoint_set::is_bytes_size_static (  )  const [inline]

returns true, if this address has a fixed size in bytes

Definition at line 268 of file endpoint_set.hpp.

bool ariba::addressing::endpoint_set::is_subset_of ( const endpoint_set set  )  const [inline]

Definition at line 262 of file endpoint_set.hpp.

bool ariba::addressing::endpoint_set::operator!= ( const endpoint_set rhs  )  const [inline]

Definition at line 405 of file endpoint_set.hpp.

endpoint_set& ariba::addressing::endpoint_set::operator= ( const endpoint_set rhs  )  [inline]

Definition at line 391 of file endpoint_set.hpp.

References bluetooth, io_mutex, ip, rfcomm, and tcp.

bool ariba::addressing::endpoint_set::operator== ( const endpoint_set rhs  )  const [inline]

checks wheter the two endpoint sets are identical

Definition at line 400 of file endpoint_set.hpp.

References bluetooth, ip, rfcomm, and tcp.

void ariba::addressing::endpoint_set::remove ( const address_vf  address  )  [inline]

static string::size_type ariba::addressing::endpoint_set::skip ( const char *  chars,
string::size_type  pos,
const std::string &  str 
) [inline, static, private]

Definition at line 126 of file endpoint_set.hpp.

Referenced by assign(), and from_string_set().

void ariba::addressing::endpoint_set::to_bytes ( uint8_t *  bytes  )  const [inline]

converts this address to a binary representation

bluetooth mac list (layer 2)

Definition at line 297 of file endpoint_set.hpp.

References bluetooth, io_mutex, ip, rfcomm, and tcp.

template<uint8_t type, class V >
size_t ariba::addressing::endpoint_set::to_bytes_dynamic ( const unordered_set< V > &  set,
uint8_t *  bytes 
) const [inline, private]

Definition at line 45 of file endpoint_set.hpp.

References internal::V().

template<uint8_t type, class V >
size_t ariba::addressing::endpoint_set::to_bytes_fixed ( const unordered_set< V > &  set,
uint8_t *  bytes 
) const [inline, private]

Definition at line 76 of file endpoint_set.hpp.

References internal::V().

size_t ariba::addressing::endpoint_set::to_bytes_size (  )  const [inline]

std::string ariba::addressing::endpoint_set::to_string (  )  const [inline]

template<class V >
std::string ariba::addressing::endpoint_set::to_string_set ( const unordered_set< V > &  set,
const std::string &  type 
) const [inline, private]

Definition at line 100 of file endpoint_set.hpp.

References internal::V().

static void ariba::addressing::endpoint_set::trim ( string &  str  )  [inline, static, private]

Definition at line 116 of file endpoint_set.hpp.

Referenced by assign(), and from_string_set().


Member Data Documentation


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

Generated on Fri Aug 14 23:39:14 2009 for Ariba by  doxygen 1.5.8