#include <GroupEId.hh>
Public Member Functions | |
| Scope (u_int8_t ttl=0, const char *publicKey=NULL) | |
| Scope (const Scope &orig) | |
| Scope & | operator= (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 |
Definition at line 34 of file GroupEId.hh.
| Scope::Scope | ( | u_int8_t | ttl = 0, |
|
| const char * | publicKey = NULL | |||
| ) |
| Scope::Scope | ( | const Scope & | orig | ) |
| Scope::~Scope | ( | ) |
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 }
u_int8_t Scope::fTTL [private] |
char* Scope::fPublicKey [private] |
Definition at line 53 of file GroupEId.hh.
Referenced by assign(), clean(), publicKey(), and publicKeySize().
1.5.2