TipcMt


Name

TipcMt — user class for constructing, looking up, and destroying message types

Synopsis

TipcMt mt(mt_num); 
TipcMt mt(mt_name); 
TipcMt mt(name, num, grammar); 
TipcMt mt(mt); 

Inheritance

Description

The TipcMt class is a user C++ interface to the TipcMt-prefix SmartSockets function calls.

Caution

None

See Also

TipcMsg, Tobj

Construction/Destruction

TipcMt::TipcMt

Syntax:
TipcMt(); 
Remarks:
Create a vacant TipcMt object.
 
  
Syntax:
TipcMt(T_INT4 mt_num); 
Remarks:
Create a TipcMt object using mt_num. mt_num is the number of the message type used to create the object. This constructor uses the C API TipcMtLookupByNum to initialize the object’s internal T_IPC_MT message type field.
C API:
TipcMtLookupByNum
 
  
Syntax:
TipcMt(T_STR mt_name); 
Remarks:
Create a TipcMt object using mt_name. mt_name is the name of a message type (not case sensitive). This constructor uses the C API TipcMtLookup to initialize the object’s internal T_IPC_MT message type field.
C API:
TipcMtLookup
 
  
Syntax:
TipcMt(T_STR name, T_INT4 num, T_STR grammar); 
Remarks:
Create a TipcMt object using name, num, and grammar. This constructor is used to create a new message type. name is the name of the new message type (not case sensitive). num is the number associated with the new message type. grammar is the description for reading and writing message files. This constructor employs the C API’s TipcMtCreate to create a new message type and initialize the object’s internal T_IPC_MT message type field.
C API:
TipcMtCreate
 
  
Syntax:
TipcMt(T_IPC_MT mt); 
Remarks:
Create a TipcMt object using mt. mt is an initialized C API T_IPC_MT type.
 
  
Syntax:
TipcMt(const TipcMt& mt); 
Remarks:
Create a TipcMt object using mt. mt is another TipcMt object. This constructor is known as the TipcMt copy constructor.

TipcMt::~TipcMt

Syntax:
~TipcMt(); 
Remarks:
This destructor just destroys the object and not the message type to which it referred.

Public Member Functions

TipcMt::Create

Syntax:
T_BOOL Create(T_STR name, T_INT4 num, T_STR grammar); 
Remarks:
Create a user-defined message type using name, num, and grammar. This member function is used to create a new message type. name is the name of the new message type (not case sensitive). num is the number associated with the new message type. grammar is the description for reading and writing message files. This constructor employs the C API’s TipcMtCreate to create a new message type and initialize the object’s internal T_IPC_MT message type field.
C API:
TipcMtCreate

TipcMt::DeliveryMode

Syntax:
T_IPC_DELIVERY_MODE DeliveryMode(); 
Remarks:
Get the delivery mode of a message type.
C API:
TipcMtGetDeliveryMode
 
  
Syntax:
T_BOOL DeliveryMode(T_IPC_DELIVERY_MODE delivery_mode); 
Remarks:
Set the delivery mode of a message type.
C API:
TipcMtSetDeliveryMode

TipcMt::DeliveryTimeout

Syntax:
T_REAL8 DeliveryTimeout(); 
Remarks:
Get the delivery timeout of a message type.
C API:
TipcMtGetDeliveryTimeout
 
  
Syntax:
T_BOOL DeliveryTimeout(T_REAL8 delivery_timeout); 
Remarks:
Set the delivery timeout of a message type.
C API:
TipcMtSetDeliveryTimeout

TipcMt::Destroy

Syntax:
T_BOOL Destroy(); 
Remarks:
Destroy a message type.
C API:
TipcMtDestroy

TipcMt::Grammar

Syntax:
T_STR Grammar(); 
Remarks:
Get the grammar of a message type.
C API:
TipcMtGetGrammar

TipcMt::HeaderStrEncode

Syntax:
T_BOOL HeaderStrEncode(); 
Remarks:
Get the header string encoding mode for a message type.
C API:
TipcMtGetHeaderStrEncode
 
  
Syntax:
T_BOOL HeaderStrEncode(T_BOOL header_str_encode); 
Remarks:
Set the header string encoding mode for a message type.
C API:
TipcMtSetHeaderStrEncode

TipcMt::LbMode

Syntax:
T_IPC_LB_MODE LbMode(); 
Remarks:
Get the load balancing mode of a message type.
C API:
TipcMtGetLbMode
 
  
Syntax:
T_BOOL LbMode(T_IPC_LB_MODE lb_mode); 
Remarks:
Set the load balancing mode of a message type.
C API:
TipcMtSetLbMode

TipcMt::Lookup

Syntax:
T_BOOL Lookup(T_INT4 num); 
Remarks:
Look up a message type by number. This member function sets the object’s internal T_IPC_MT message type field.
C API:
TipcMtLookupByNum
 
  
Syntax:
T_BOOL Lookup(T_STR name): 
Remarks:
Look up a message type by name. This member function sets the object’s internal T_IPC_MT message type field.
C API:
TipcMtLookup

TipcMt::MessageType

Syntax:
T_IPC_MT MessageType() const; 
Remarks:
Return the internal T_IPC_MT message type of the object.

TipcMt::Name

Syntax:
T_STR Name(); 
Remarks:
Get the name of a message type.
C API:
TipcMtGetName

TipcMt::Num

Syntax:
T_INT4 Num(); 
Remarks:
Get the number of a message type.
C API:
TipcMtGetNum

TipcMt::Print

Syntax:
T_BOOL Print(T_OUT_FUNC func); 
Remarks:
Print all information about a message type.
C API:
TipcMtPrint

TipcMt::Priority

Syntax:
T_INT2 Priority(); 
Remarks:
Get the priority of a message type.
C API:
TipcMtGetPriority
 
  
Syntax:
T_BOOL Priority(T_INT2 priority); 
Remarks:
Set the priority of a message type.
C API:
TipcMtSetPriority

TipcMt::SetPriorityUnknown

Syntax:
T_BOOL SetPriorityUnknown(); 
Remarks:
Set the priority of a message type to unknown.
C API:
TipcMtSetPriorityUnknown

TipcMt::UserProp

Syntax:
T_INT4 UserProp(); 
Remarks:
Get user-defined property from a message type.
C API:
TipcMtGetUserProp
 
  
Syntax:
T_BOOL UserProp(T_INT4 user_prop); 
Remarks:
Set user-defined property of a message type.
C API:
TipcMtSetUserProp

Conversion Operators

TipcMt::T_IPC_MT

Syntax:
operator T_IPC_MT() const; 
Remarks:
Convert a TipcMt object to a C API T_IPC_MT type by returning the internal T_IPC_MT message type.

Static Public Member Functions

TipcMt::Traverse

Syntax:
static T_PTR Traverse(T_IPC_MT_TRAV_FUNC func, T_PTR arg); 
Remarks:
Traverse all message types.
C API:
TipcMtTraverse

Example

This example creates a message type named "xyz_coord" that uses three integer coordinates, creates an XYZ_COORD message, appends fields, and writes the message to a message file. See the description of the TipcMtCreate function in the TIBCO SmartSockets Application Programming Interface for a corresponding C language version of this code fragment.

#include <rtworks/cxxipc.hxx> 
main() 
{ 
#define USER_MT_XYZ_COORD 2000 
 
  // Create the message type 
  TipcMt mt; 
  mt.Create("xyz_coord", USER_MT_XYZ_COORD, "int4 int4 int4"); 
 
  // Create a message and append fields 
  TipcMsg msg(mt); 
 
  msg << (T_INT4)5 << (T_INT4)2 << (T_INT4)9; 
 
  // Create a message file 
  TipcMsgFile msg_file("test.msg", T_IPC_MSG_FILE_CREATE_WRITE); 
 
  if (!msg_file) { 
    // error 
  } 
 
  // Write the message out 
  msg_file << msg.Message(); 
   
} 

The program writes this to the message file test.msg:

xyz_coord _null 5 2 9 

TIBCO SmartSockets™ cxxipc Class Library
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com