JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
ToolTalk User's Guide
search filter icon
search icon

Document Information


1.  Introducing the ToolTalk Service

2.  An Overview of the ToolTalk Service

3.  Message Patterns

4.  Setting Up and Maintaining the ToolTalk Processes

5.  Maintaining Application Information

6.  Maintaining Files and Objects Referenced in ToolTalk Messages

7.  Participating in ToolTalk Sessions

8.  Sending Messages

9.  Dynamic Message Patterns

10.  Static Message Patterns

11.  Receiving Messages

12.  Objects

Object-Oriented Messaging

Object Data

Creating Object Specs

Assigning Otypes

Determining Object Specification Properties

Storing Spec Properties

Adding Values to Properties

Writing Object Specs

Updating Object Specs

Maintaining Object Specs

Examining Spec Information

Comparing Object Specs

Querying for Specific Specs in a File

Moving Object Specs

Destroying Object Specs

Managing Object and File Information

Managing Files that Contain Object Data

Managing Files that Contain ToolTalk Information

An Example of Object-Oriented Messaging

13.  Managing Information Storage

14.  Handling Errors

A.  Migrating from the Classing Engine to the ToolTalk Types Database

B.  A Simple Demonstration of How the ToolTalk Service Works

C.  The ToolTalk Standard Message Sets

D.  Frequently Asked Questions



Creating Object Specs

To instruct the ToolTalk service to deliver messages to your objects, you create a spec that identifies the object and its otype. lists the ToolTalk functions you use to create and write object spec.

Table 12-1 Functions to Create

ToolTalk Function
tt_spec_create(const char *filepath)
Creates spec. Return type is char*.
tt_spec_prop_set(const char *objid, const char *propname, const char *value)
Sets property to specified string value. Return type is Tt_status.
tt_spec_prop_add(const char *objid, const char *propname, const char *value)
Adds string property. Return type is Tt_status.
tt_spec_bprop_add(const char *objid, const char *propname, const unsigned char *value, int length)
Adds byte array property. Return type is Tt_status.
tt_spec_bprop_set(const char *objid, const char *propname, const unsigned char *value, int length)
Sets property to specified byte array value. Return type is Tt_status.
tt_spec_type_set(const char *objid, const char *otid)
Sets object type of spec. Return type is Tt_status.
tt_spec_write(const char *objid)
Writes spec to database. Return type is Tt_status.

To create an object spec in memory and obtain an objid for the object, use tt_spec_create.

Assigning Otypes

To assign an otype for the object spec, use tt_spec_type_set. You must set the type before the spec is written for the first time. It cannot be changed.

Note - If you create an object spec without assigning an otype or with an otype that is unknown to the ToolTalk Types Database, messages addressed to the object cannot be delivered. (The ToolTalk service does not verify that the otype you specified is known to the ToolTalk Types Database.)

Determining Object Specification Properties

You can determine what properties you want associated with an object; you add these properties to a spec. The ToolTalk service recognizes that it is not always possible to store information in your own internal data; for example, the objid for objects in plain ASCII text files. You can store the location of the objid in a spec property and then use this location to identify where the object is in your tool's internal data structures.

The spec properties are also a convenience for the user. A user may want to associate properties (such as a comment or object name) with the object that they can view later. Your application or another ToolTalk-based tool can search for and display these properties for the user.

Storing Spec Properties

To store properties in a spec, use tt_spec_prop_set.

Adding Values to Properties

To add to the list of values associated with the property, use tt_spec_prop_add.