Creating the Prototype
This section describes the two calls that must be made to the TV::prototype command. The first tells TotalView to create a prototype and the second defines this prototype's properties.
The TV::prototype create command creates a new prototype object. Its sole argument indicates if you are defining an array or struct prototype. This ID for this object acts as a handle that you use when working with the prototype. The second command, TV::prototype set, defines the prototype's properties.
Here are the commands that set up the prototype for std::vector:
set proto_id [TV::prototype create array]
TV::prototype set $proto_id \
name {^(class|struct) (std::)?vector *<.*>$} \
language C++ \
validate_callback vector_validate \
typedef_callback vector_typedef \
type_callback vector_type \
rank_callback vector_rank \
bounds_callback vector_bounds \
address_callback vector_address
The first statement creates the prototype and assigns the returned ID to the proto_id variable. The next statement sets its properties. While these statements create the new prototype and define its properties, the prototype is simply a definition of what can be done. This changes when you activate it by adding it to an image. For example, you could use the apply_prototype_to_focus routine described in Applying Prototypes to Images to activate it. Here is how you would use this function:
apply_prototype_to_focus $proto_id