Scope Class Reference

#include <GroupEId.hh>


Public Member Functions

 Scope (u_int8_t ttl=0, const char *publicKey=NULL)
 Scope (const Scope &orig)
Scopeoperator= (const Scope &rightSide)
 ~Scope ()
u_int8_t ttl () const
const char * publicKey () const
unsigned publicKeySize () const

Private Member Functions

void assign (u_int8_t ttl, const char *publicKey)
void clean ()

Private Attributes

u_int8_t fTTL
char * fPublicKey


Detailed Description

Definition at line 34 of file GroupEId.hh.


Constructor & Destructor Documentation

Scope::Scope ( u_int8_t  ttl = 0,
const char *  publicKey = NULL 
)

Definition at line 38 of file GroupEId.cpp.

References assign().

00038                                                 {
00039   assign(ttl, publicKey);
00040 }

Scope::Scope ( const Scope orig  ) 

Definition at line 42 of file GroupEId.cpp.

References assign(), publicKey(), and ttl().

00042                               {
00043   assign(orig.ttl(), orig.publicKey());
00044 }

Scope::~Scope (  ) 

Definition at line 60 of file GroupEId.cpp.

References clean().

00060               {
00061   clean();
00062 }


Member Function Documentation

Scope & Scope::operator= ( const Scope rightSide  ) 

Definition at line 46 of file GroupEId.cpp.

References assign(), clean(), fTTL, NULL, publicKey(), and ttl().

00046                                               {
00047   if (&rightSide != this) {
00048     if (publicKey() == NULL
00049         || strcmp(publicKey(), rightSide.publicKey()) != 0) {
00050       clean();
00051       assign(rightSide.ttl(), rightSide.publicKey());
00052     } else { // need to assign TTL only
00053       fTTL = rightSide.ttl();
00054     }
00055   }
00056 
00057   return *this;
00058 }

u_int8_t Scope::ttl (  )  const [inline]

Definition at line 41 of file GroupEId.hh.

References fTTL.

Referenced by operator=(), and Scope().

00042                 { return fTTL; }

const char* Scope::publicKey (  )  const [inline]

Definition at line 44 of file GroupEId.hh.

References fPublicKey.

Referenced by operator=(), and Scope().

00045                 { return fPublicKey; }

unsigned Scope::publicKeySize (  )  const

Definition at line 64 of file GroupEId.cpp.

References fPublicKey, and NULL.

00064                                     {
00065   return fPublicKey == NULL ? 0 : strlen(fPublicKey);
00066 }

void Scope::assign ( u_int8_t  ttl,
const char *  publicKey 
) [private]

Definition at line 26 of file GroupEId.cpp.

References fPublicKey, fTTL, NULL, and strDup().

Referenced by operator=(), and Scope().

00026                                                       {
00027   fTTL = ttl;
00028 
00029   fPublicKey = strDup(publicKey == NULL ? "nokey" : publicKey);
00030 }

void Scope::clean (  )  [private]

Definition at line 32 of file GroupEId.cpp.

References fPublicKey, and NULL.

Referenced by operator=(), and ~Scope().

00032                   {
00033   delete[] fPublicKey;
00034   fPublicKey = NULL;
00035 }


Field Documentation

u_int8_t Scope::fTTL [private]

Definition at line 52 of file GroupEId.hh.

Referenced by assign(), operator=(), and ttl().

char* Scope::fPublicKey [private]

Definition at line 53 of file GroupEId.hh.

Referenced by assign(), clean(), publicKey(), and publicKeySize().


The documentation for this class was generated from the following files:
Generated on Tue Jul 22 06:41:07 2008 for live by  doxygen 1.5.2