Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide
12-2
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 12 Helper Classes
Arg Class
Arg Class
The Arg is a generic class used in parameters or return values in CIL methods. Information sent by CTI
OS server to the CIL in an event is packed in an Arguments object where each element of the array is an
object of type Arg. An Arg object’s absolute data type is determined by the type of data it stores. The
basic types an object can store are identified by the enumerated constants in
OS server to the CIL in an event is packed in an Arguments object where each element of the array is an
object of type Arg. An Arg object’s absolute data type is determined by the type of data it stores. The
basic types an object can store are identified by the enumerated constants in
.
Arg class methods do conversion between types whenever possible. For example, you can do a
SetValue(25) and then do a GetValueString() which returns the string “25”. You can also do a SetValue(“25”)
and then do a GetValueIntObj which returns an Integer object containing the numeric value 25. However, if
you call SetValue “abc” and try to retrieve it as an int, it fails.
SetValue(25) and then do a GetValueString() which returns the string “25”. You can also do a SetValue(“25”)
and then do a GetValueIntObj which returns an Integer object containing the numeric value 25. However, if
you call SetValue “abc” and try to retrieve it as an int, it fails.
lists the available Arg class methods.
In many scenarios, programmers stick to Arguments (see the preceding section), which wraps many Arg
methods and encapsulates a collection of Arg objects.
methods and encapsulates a collection of Arg objects.
AddRef
The AddRef method increments the reference count for the data item. It is necessary to call this if you
are storing a pointer to the item for some time (for example, if you plan to store and use Arguments
received in an event handler after the event thread has returned to the calling code). When you are finished
with the item, you must call the Release method or a memory leak occurs.
are storing a pointer to the item for some time (for example, if you plan to store and use Arguments
received in an event handler after the event thread has returned to the calling code). When you are finished
with the item, you must call the Release method or a memory leak occurs.
Syntax
C++:
unsigned long AddRef()
COM:
HRESULT AddRef()
VB, Java, .NET:
Not used
Table 12-1
Arg Class Methods
Method
Description
AddRef
Increments the reference count for the data item.
Clone
Creates an exact copy of the Arg object.
CreateInstance
Creates an Arg object.
DumpArg
Builds a string containing the value stored in the Arg.
GetType
Returns the type of the data stored in the argument (one
of the values in
of the values in
GetValueInt
GetValueUInt
GetValueUInt
GetValueUShort
GetValueShort
GetValueBool
GetValueString
GetValueUInt
GetValueUInt
GetValueUShort
GetValueShort
GetValueBool
GetValueString
Returns the value stored in the argument.
SetValue
Sets the data in the Arg object.