You are here: SwitchKit® Development Environment - TCAP Interface User’s Guide > 6 SKTAL Parameter Classes > Class TCAP_Component
Purpose
The purpose of the TCAP_Component interface is to define the base class for all TCAP components. The class, while not abstract, should be considered as such, it is not intended that a user ever create a TCAP_Component class object.
The following methods are used within the TCAP_Component
// Type
SKTAL_USHORT GetComponentType() const;
// Last component
SKTAL_USHORT GetLast() const;
// Invoke ID
void SetInvokeID(const SKTAL_OCTET val);
SKTAL_OCTET GetInvokeID() const;
// Send
static int Send(SKTAL_HANDLE handle,
TCAP_Dialogue* dlg,
TCAP_Component* cpt);
// Receive
static int Receive(SKTAL_HANDLE handle,
SKTAL_Event& ev,
TCAP_Dialogue* dlg,
TCAP_Component** cpt);
virtual void Print(std::ostream& os) const;
Description
Returns the type of this component.
Syntax
SKTAL_USHORT GetComponentType() const;
Input Parameters, Input/Output Parameters & Output Parameters
None
Return Value
The type of this component is an unsigned short:
If defined ITU:
• TCPPT_TC_INVOKE
• TCPPT_TC_RESULT_L (where L means last)
• TCPPT_TC_RESULT_NL (where NL means not last)
• TCPPT_TC_U_ERROR
• TCPPT_TC_L_REJECT
• TCPPT_TC_U_REJECT
• TCPPT_TC_R_REJECT
• TCPPT_TC_L_CANCEL
• TCPPT_TC_U_CANCEL
• TCAP_PT-TC_TIMER_RESET
If defined ANSI:
• TCPPT_TC_INVOKE_NL
• TCPPT_TC_INVOKE (Same as invoke last)
• TCPPT_TC-RESULT-L
• TCPPT_TC_RESULT_NL
• TCPPT_TC_ERROR
• TCPPT_TC_REJECT
• TCPPT_TC_CANCEL
Description
Returns a Boolean indicating if this is the last component in this PDU
Syntax
SKTAL_USHORT GetLast() const;
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
true: True if this instance is the last component in this PDU.
false: If this instance is not the last component in this PDU
Description
This method takes an invoke ID from user and converts it into the form expected by TCAP. As invoke IDs are common to all TCAP components, the SetInvokeID method is defined in the TCAP_Component base class.
Syntax
void SetInvokeID(const SKTAL_OCTET val);
Input Parameters
val: The invoke ID value. Range is 0-255
Input/Output Parameters and Output Parameters
None
Return Value
None
Description
This method returns the invoke ID of a component. Since invoke IDs are common to all TCAP components, the GetInvokeID method is defined in the TCAP_Component base class. If no invoke ID has been received then the invoke ID is set to zero.
Syntax
SKTAL_OCTET GetInvokeID() const;
Input Parameters, Input/Output Parameters, & Output Parameters
None
Return Value
The invoke ID as an unsigned character.
Description
This method sends a TCAP message and returns a Boolean indication if the message is successfully sent. This send method is static. The value of SKTAL_SUCCESS is 0.
Syntax
static int Send(SKTAL_HANDLE handle,
TCAP_Dialogue* dlg,
TCAP_Component* cpt);
Input Parameters
handle: The transport being sent. For getting the handle use sktal_getTCAPHandle() API
dlg: The TCAP dialogue primitive of which this component is part.
cpt: The TCAP component primitive of which this component is part.
Input/Output Parameters and Output Parameters
None
Return Value
If the message is successfully sent, SKTAL_SUCCESS is returned. Any other return value indicates an error.
Description
This method receives a TCAP message and returns a Boolean indication if the message is successfully received. This Receive method is static.
Syntax
static int Receive(SKTAL_HANDLE handle,
SKTAL_Event& ev,
TCAP_Dialogue* dlg,
TCAP_Component** cpt);
Input Parameters
handle: The transport that received this event. For getting the handle use sktal_getTCAPHandle() API
ev: The event primitive this component is associated with.
dlg: The dialogue primitive this component is associated with.
cpt: The component primitive this component is associated with.
Input/Output Parameters
None
Output Parameters
cpt: The constructed component
Return Value
SKTAL_SUCCESS: If the component is successfully received. Any other return code indicates an error.
Description
This method prints the contents of the component to the output stream that is passed in to the method. This print method is virtual.
Syntax
virtual void Print (std::ostream& os) const;
Input Parameters
os: The output stream to print the contents to
Input/Output Parameters and Output Parameters
None
Return Value
None