A type object is a prototype for one or more type instances stored
in a VOB database.
If a type object exists, a user can create an instance of it by entering
the appropriate command (for example, cleartool mklabel to
create an instance of a label type object).
A VOB can store several kinds of type objects.
| Type |
Mnemonic |
Description |
| Element type |
eltype |
Instances are elements. |
| Branch type |
brtype |
Instances are branches. |
| Hyperlink type |
hltype |
Instances are VOB hyperlinks that connect two related objects. |
| Trigger type |
trtype |
Instances are triggers. |
VOBs also store type objects that are used only to modify instances of
other type objects.
| Type |
Mnemonic |
Description |
| Label type |
lbtype |
Instances are labels that can be attached to any version
object. |
| Attribute type |
attype |
Instances are attributes (name=value pairs)
that can be attached to any instance of a type object. |
The mnemonic associated with each type object can be used in an object-selector
prefix to
cleartool commands such as
describe.
For example, to describe a branch type named
v4_patch, use the
brtype mnemonic:
cleartool describe brtype:v4_patch
Instances of type objects
After
a type object is created, users can create instances of the type. Creating
an instance of a type creates a reference to the type object. For example,
attaching the label BASELEVEL_7.0 to a particular version does not
make a copy of the BASELEVEL_7.0 type object. Instead, it establishes
a connection between the element version and the label type object. The following
table describes how type objects are used by cleartool commands
that create instances of types.
- Type object
- Relationship of type object to type instance
- Element
- Each file or directory element in a VOB is created by mkelem or mkdir as
an instance of an existing element type in that VOB.
- Branch
- Each branch in an element is created by mkbranch as
an instance of an existing branch type in that element’s VOB.
- Label
- The mklabel command labels an object with an instance
of an existing label type.
- Attribute
- The mkattr command annotates a version, branch, element,
VOB symbolic link, or hyperlink with an attribute, by creating an instance
of an existing attribute type. Each instance of an attribute has a particular
value—a string, an integer, and so on.
- Hyperlink
- The mkhlink command creates a hyperlink object, which
is an instance of an existing hyperlink type. A hyperlink connects two objects,
which can be in the same VOB or in different VOBs.
- Trigger
- The mktrigger command creates a trigger object, which
is an instance of an existing trigger type. The trigger may be attached to
one or more elements.
This scheme makes it easy to administer type objects and
their instances. For example, renaming the label type object
BASELEVEL_7.0 to
BL7.0 renames
all its existing instances.
Note: Creating an instance does not make a copy
of the type object, but in certain cases it does create a new object. For
example, the mkbranch command creates a new branch object
and creates a reference that connects the new branch object to an existing
branch type object.
Scope of type objects
The
scope of a type object is defined when the object is created. Local type objects
can only be used to create instances in the VOB in which they are defined.
Global type objects can be used to create instances in any VOB that is part
of an administrative VOB hierarchy beneath the VOB in which the global type
is defined. For more information, see
Administrative VOB hierarchies and global types.
Note: Trigger type objects cannot be global types.
Predefined and user-defined
type objects
Each VOB is created with a set of predefined type objects.
You can create additional type objects as needed with any of the following
the
cleartool commands:
- mkattype creates or modifies an attribute type object
- mkbrtype creates or modifies a branch type object
- mkeltype creates or modifies an element type object
- mkhltype creates or modifies a hyperlink type object
- mklbtype creates or modifies a label type object
- mktrtype creates or modifies a trigger type object
The reference page for each of these commands lists all predefined
type objects associated with the command. (For example, the mkeltype reference
page lists all of the predefined element types.) You can also use the Rational® ClearCase® Administration
Console or the cleartool lstype command
to list the type objects defined in a given VOB.