Simple Geolocalization and Course Transmission Protocol (SGCTP)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
SGCTP::CPrincipal Class Reference

SGCTP principal. More...

#include <sgctp/principal.hpp>

Public Member Functions

 CPrincipal ()
 
 ~CPrincipal ()
 
void reset ()
 Resets all parameters. More...
 
void erasePassword ()
 Erases the principal password (and nullifies memory) More...
 
void setID (uint64_t _ui64tID)
 Sets the principal ID. More...
 
void setPassword (const char *_pcPassword)
 Sets the principal password. More...
 
void addPayloadType (uint8_t _ui8tPayloadType)
 Adds an allowed payload type. More...
 
uint64_t getID () const
 Returns the principal ID. More...
 
const char * getPassword () const
 Returns the principal password. More...
 
bool hasPayloadTypes () const
 Returns whether payload types have been allowed. More...
 
bool hasPayloadType (uint8_t _ui8tPayloadType) const
 Returns the allowed payload types. More...
 
int read (const char *_pcPrincipalsPath, uint64_t _ui64tID)
 Retrieves the principal paremeters from the given file. More...
 

Static Public Attributes

static const uint16_t MAX_PASSWORD_LENGTH = SGCTP_MAX_PASSWORD_LENGTH
 Maximum password length. More...
 

Private Attributes

uint64_t ui64tID
 ID. More...
 
char pcPassword [SGCTP_MAX_PASSWORD_SIZE]
 Password (max. 255 characters) More...
 
set< uint8_t > ui8tPayloadType_set
 Allowed payload types. More...
 

Detailed Description

SGCTP principal.

This class gathers the parameters and credentials specific to a SGCTP principal (client or agent).

Definition at line 44 of file principal.hpp.

Constructor & Destructor Documentation

SGCTP::CPrincipal::CPrincipal ( )
inline

Definition at line 73 of file principal.hpp.

SGCTP::CPrincipal::~CPrincipal ( )
inline

Definition at line 77 of file principal.hpp.

Member Function Documentation

void CPrincipal::reset ( )

Resets all parameters.

Definition at line 44 of file principal.cpp.

void CPrincipal::erasePassword ( )

Erases the principal password (and nullifies memory)

Definition at line 51 of file principal.cpp.

void SGCTP::CPrincipal::setID ( uint64_t  _ui64tID)
inline

Sets the principal ID.

Definition at line 98 of file principal.hpp.

void CPrincipal::setPassword ( const char *  _pcPassword)

Sets the principal password.

Definition at line 56 of file principal.cpp.

void CPrincipal::addPayloadType ( uint8_t  _ui8tPayloadType)

Adds an allowed payload type.

Definition at line 66 of file principal.cpp.

uint64_t SGCTP::CPrincipal::getID ( ) const
inline

Returns the principal ID.

Definition at line 113 of file principal.hpp.

const char* SGCTP::CPrincipal::getPassword ( ) const
inline

Returns the principal password.

Definition at line 118 of file principal.hpp.

bool CPrincipal::hasPayloadTypes ( ) const

Returns whether payload types have been allowed.

Definition at line 75 of file principal.cpp.

bool CPrincipal::hasPayloadType ( uint8_t  _ui8tPayloadType) const

Returns the allowed payload types.

Definition at line 80 of file principal.cpp.

int CPrincipal::read ( const char *  _pcPrincipalsPath,
uint64_t  _ui64tID 
)

Retrieves the principal paremeters from the given file.

Definition at line 91 of file principal.cpp.

Member Data Documentation

const uint16_t SGCTP::CPrincipal::MAX_PASSWORD_LENGTH = SGCTP_MAX_PASSWORD_LENGTH
static

Maximum password length.

Definition at line 53 of file principal.hpp.

uint64_t SGCTP::CPrincipal::ui64tID
private

ID.

Definition at line 62 of file principal.hpp.

char SGCTP::CPrincipal::pcPassword[SGCTP_MAX_PASSWORD_SIZE]
private

Password (max. 255 characters)

Definition at line 64 of file principal.hpp.

set<uint8_t> SGCTP::CPrincipal::ui8tPayloadType_set
private

Allowed payload types.

Definition at line 66 of file principal.hpp.


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