OSB_LIB::ServiceElement Class Reference

Collaboration diagram for OSB_LIB::ServiceElement:

Collaboration graph
[legend]
List of all members.

Detailed Description

ServiceElement represents the "actual network service".

Every "actual network service" (e.g. T11, S21) is represented by an instance of class ServiceElement.

Definition at line 65 of file service.h.

Public Types

Public Member Functions

Read access to the data member:
Database operations:
Equality operator:

Static Public Member Functions

Utility functions:

Private Attributes

Friends


Member Typedef Documentation

typedef Id<ServiceElement> OSB_LIB::ServiceElement::Oid

Typesave object identification, database link.

Definition at line 73 of file service.h.

typedef unsigned char OSB_LIB::ServiceElement::ServiceCode

Declare char as ServiceCode.

Definition at line 76 of file service.h.


Member Enumeration Documentation

enum OSB_LIB::ServiceElement::ServiceType

Available service types.

Remarks:
When adding a new service type, change the static member functions toChar and toServiceType accordingly.
Enumerator:
stUnknown 
gsmTelephony  GSM telephony services.
gsmBearer  GSM bearer services.
gsmSupplementary  GSM supplementary services.
pstnTelephony  PSTN telephony services.
isdnTelephony  ISDN telephony services.
stMax 

Definition at line 84 of file service.h.


Constructor & Destructor Documentation

OSB_LIB::ServiceElement::ServiceElement (  ) 

Default constructor.

It initializes:

OSB_LIB::ServiceElement::ServiceElement ( const Oid oid,
ServiceType  type,
ServiceCode  code,
const Oid  pid 
)

Constructor of the service element class.

This constructor will create an instance of ServiceElement that represent an 'actual network service'.

Parameters:
oid Unique id and database links of this object.
type Type of the service.
code Numbering that shows the exact service.
pid Parent id of this object.

OSB_LIB::ServiceElement::ServiceElement ( ServiceType  type,
ServiceCode  code 
)

Constructor with object id.

Parameters:
type The service type.
code The service code.
Use this constructor when the object id and the id of the parent are not relevant.


Member Function Documentation

bool OSB_LIB::ServiceElement::insert ( const OSB_DB::Session session  ) 

Insert a service element into database.

A new object is inserted. All attribute of the object has been set except object id. The object id will only be set by the function if the insertion is successful.

Returns:
true if success else false.

const Oid& OSB_LIB::ServiceElement::oid (  )  const

Retrieve the object's id_.

bool OSB_LIB::ServiceElement::operator< ( const ServiceElement rhs  )  const

Less than operator for service elements.

Compares 1st by service type and 2nd by service code.

bool OSB_LIB::ServiceElement::operator== ( const ServiceElement se  )  const

Compare two ServiceElement whether they have the same serviceType_ and serviceCode_.

Parameters:
se ServiceElement to compare to.
Returns:
true if serviceType_ and serviceCode_ are the same else false.

const Oid& OSB_LIB::ServiceElement::pId (  )  const

Retrieve the object's parent's id_.

bool OSB_LIB::ServiceElement::read ( const OSB_DB::Session session  ) 

Read a service element from database.

The object id is used to gather other info from database and then populate the object's attributes.

Returns:
true if success else false.

bool OSB_LIB::ServiceElement::remove ( const OSB_DB::Session session  ) 

Remove a service element from database.

After the function call, oid of this object will be unset to indicate that there is no such entry anymore in the database.

Returns:
true if success else false.

const ServiceCode& OSB_LIB::ServiceElement::serviceCode (  )  const

Retrieve the object's serviceCode_.

const ServiceType& OSB_LIB::ServiceElement::serviceType (  )  const

Retrieve the object's serviceType_.

const std::string OSB_LIB::ServiceElement::shortCode (  )  const

3 letter service identifier.

Returns:
A 3 letter code that (almost) uniquely identifies the service type and code:
The format is TXX with
  • T: service type ('?' if unknown)
  • XX: service code as 2 hex-digit string.

static char OSB_LIB::ServiceElement::toChar ( const ServiceType  st  )  [static]

Convert service type to one character database code.

Parameters:
st The service type value to convert.
Exceptions:
Osb exception if `st' is invalid.
Returns:
The database character code for `st'.

static std::string OSB_LIB::ServiceElement::toHex ( ServiceCode  c  )  [static]

Show service code as 2 Hex numbers.

Convert the service code, which store internally as type char to 2 HEX numbers represented in a string.

Parameters:
c Service code to convert.
Returns:
A 2 hex-digit string representing the service code.

static ServiceType OSB_LIB::ServiceElement::toServiceType ( char  c  )  [static]

Convert one character database code to a ServiceType.

Remarks:
The caller of the function is responsible to verify the return value and to take appropriate actions should it be `stUnknown', which means the input service type is not recognized.
Parameters:
c Character to convert.
Returns:
The status value that corresponds to `c'.
stUnknown if `c' does not match a supported ServiceType.

bool OSB_LIB::ServiceElement::update ( const OSB_DB::Session session  ) 

Update a service element in the database.

Old entry in the database identify by the object id will be replaced with the new data from this object.

Returns:
true if success else false.


Friends And Related Function Documentation

friend struct OSB_DB::ServiceElementGw [friend]

The database gateway needs to populate data members after construction.

Definition at line 70 of file service.h.


Member Data Documentation

Oid OSB_LIB::ServiceElement::id_ [private]

Database link of this object.

Definition at line 266 of file service.h.

Oid OSB_LIB::ServiceElement::pId_ [private]

Database link of the parent object.

Definition at line 278 of file service.h.

ServiceCode OSB_LIB::ServiceElement::serviceCode_ [private]

Numbering appended to the serviceType_ to show the actual network service.

Definition at line 275 of file service.h.

ServiceType OSB_LIB::ServiceElement::serviceType_ [private]

Network service type.

Definition at line 269 of file service.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:16:21 2006 for OSB Library by  doxygen 1.4.7