Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 668
 
12-15
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1)
 
Chapter 12      Helper Classes
Arguments Class
modified array is sent to CTI OS server. A problem may occur depending on 
timing, as there are multiple threads involved: the thread pulling items off the 
queue and the thread modifying the Arguments array. If the queued message is 
sent to CTI OS before the Arguments array is modified, the problem will not 
occur.
To avoid this problem, call the Clone method on the initial Arguments array and 
modify the copy rather than modifying the original. For example, the preceding 
example would change as follows:
  •
Programmer passes an Arguments array (initialArray) into a CTI OS SDK 
method (methodA)
  •
MethodA returns
  •
modifiedArray = initialArray.Clone()
  •
Programmer modifies modifiedArray
  •
Programmer passes the modifiedArray into another CTI OS SDK method 
(methodB)
AddItem (C++, COM, VB only)
The AddItem method expects a key-value pair. The key value may be a string or 
an integer. The value may be a string, an integer, or an object reference. If there 
is an entry with the same key, it will be replaced with this entry, otherwise the 
new key-value pair will be added to the arguments array. Keys are not case 
sensitive. Leading and trailing spaces are always removed from the key.
Syntax
C++:
bool AddItem( std::string& key, int value );
bool AddItem( std::string& key, unsigned int value );
bool AddItem( std::string& key, unsigned short value );
bool AddItem( std::string& key, short value );
bool AddItem( std::string& key, bool value );
bool AddItem( std::string& key, char * pchar );
bool AddItem( std::string& key, std::string& value );
bool AddItem( std::string& key, Arg& value );
bool AddItem( std::string& key, const Arg& value );
bool AddItem( std::string& key, Arguments& value );
bool AddItem( std::string& key, const Arguments& value);