C++ Class Library Features


This library provides many new features not included in the cxxipc library, including the SmartSockets namespace, use of native type names, improved exception and callback handling, wrappers for utilities functions, and support for multiple RTserver connections.

C++ Namespace

The C++ class library uses the SmartSockets namespace to simplify class names. If there are conflicts between the SmartSockets C++ library and another library, prefix SmartSockets class names with SmartSockets::. For example, TipcConn can also be written as SmartSockets::TipcConn.

Native Type Names

This is a mapping of SmartSockets types to native C++ types:

Type
Declared as:
T_INT1
int1
T_UINT1
uint1
T_INT2
int2
T_UINT2
uint2
T_INT4
int4
T_UINT4
uint4
T_INT8
int8
T_REAL4
real4
T_REAL8
real8
T_REAL16
real16

Wherever possible, these names are also changed:

Name
Changed to:
T_STR
char *
T_PTR
void *
T_BOOL
bool

Exception Handling

The Exception class is used to categorize errors. The C++ class library explicitly declares which exceptions are thrown from each class. The exception hierarchy follows the main classes in the class hierarchy. For example, exceptions generated from methods in the TipcMt class throw TipcMtException exceptions. See Exception Handling for more information on the Exception class.

Constant Objects

The C++ class library uses the const indicator for all methods that do not modify the contents of an object. For example, methods that received a literal string in the cxxipc library now receive const char *.

Callback Support

Callback objects can now be passed as parameters into registration methods. If registration is successful, the registration method returns a pointer to the callback class and a template parameter showing the type of callback used. The callback classes are:

  • ConnectionCallBack
  • ErrorCallBack
  • DecodeCallBack
  • MessageCallBack
  • EncodeCallBack
  • MessageQueueCallBack

Utilities Function Wrappers

The C++ class library includes support for some Tut* functions from the C API. These methods are in four new classes:

The classes and their methods, with their corresponding C API functions, are shown in Table 1.

Table 1 Utilities Function Wrappers
Class
Method Name
C Function Name
System
 
 
 
exit
TutExit
 
getFloatingPointFormat
TutGetRealFormat
 
getIntFormat
TutGetIntFormat
 
getTime
TutGetWalltime
 
runCommand
TutSystem
 
sleep
TutSleep
Utilities
 
 
 
getSocketDir
TutGetSocketDir
 
getVersionName
TutGetVersionName
 
getVersionNumber
TutGetVersionNumber
 
parseCommandFile
TutCommandParseFile
 
parseCommandString
TutCommandParseString
 
parseTypedCommandString
TutCommandParseTypedString
Option
 
 
 
create
TutOptionCreate
 
destroyOption
TutOptionDestroy
 
getBool
TutOptionGetBool
 
getEnum
TutOptionGetEnum
 
getEnumList
TutOptionGetEnumList
 
getName
TutOptionGetName
 
getReadOnly
TutOptionGetReadOnly
 
getReal8
TutOptionGetNum
 
getRequired
TutOptionGetRequired
 
getString
TutOptionGetStr
 
getStringList
TutOptionGetStrList
 
getType
TutOptionGetType
 
isKnown
TutOptionGetKnown
 
option constructor
TutOptionLookup
 
optionChangeCbCreate
TutOptionChangeCbCreate
 
setBool
TutOptionSetBool
 
setEnum
TutOptionSetEnum
 
setEnumList
TutOptionSetEnumList
 
setReadOnly
TutOptionSetReadOnly
 
setReal8
TutOptionSetNum
 
setRequired
TutOptionSetRequired
 
setString
TutOptionSetStr
 
setStringList
TutOptionSetStrList
 
setUnKnown
TutOptionSetUnknown
XML
 
 
 
clone
TutXmlClone
 
createFromStaticBuf
TutXmlCreateStatic
 
getString
TutXmlGetStr
 
option constructor
TutXmlCreate
 
setString
TutXmlSetStr

Multiple Connection Support

The C++ class library supports multiple connections, allowing an RTclient to connect to multiple RTservers. Multiple connections are supported by TipcSrv class, in conjunction with these methods and classes:

The C++ class library has the same advantages and limitations as the SmartSockets multiple connections API. Some SmartSockets commands, such as connect, disconnect, subscribe, and unsubscribe, cannot be used with C++.


TIBCO SmartSockets™ C++ User’s Guide
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com