OMget_obj_seq


Synopsis


int  OMget_obj_seq (
OMobj_id  object_id,
OMobj_id  template_id,
int  mode  );

Description

OMget_obj_seq returns the sequence number of an object.

Arguments

object_id

The id of an object.

template_id

The optional id of a template object.

template_id is useful when object_id refers to an object with subobjects and the mode is OM_SEQ_SUBOBJS. See mode , below.

Typically, you set template_id to OMnull_obj to indicate no template.

mode

Indicates how the sequence number is obtained:

Mode

 

Meaning

 

0

Returns the sequence number of object_id . This does not include the sequence number of any subobjects or any connections that this object might have.

OM_SEQ_SUBOBJS

Useful when object_id has subobjects, returns the largest sequence number of object_id and any of its subobjects, both immediate and lower level.

If template_id is specified, the subobjects to be checked are limited to those whose names match the subobjects of template_id . See Example 2 below.

OM_SEQ_PTRS

Useful when object_id is a pointer (by-pointer or by-reference mode), returns the largest sequence number of object_id and any of the objects in the chain of references.

OM_SEQ_VAL

Combination of OM_SEQ_SUBOBJS and OM_SEQ_PTRS. AVS/Express returns the largest sequence number of object_id and its subobjects. If object_id or any subobject is a pointer, AVS/Express determines that object's largest sequence number in the chain of references. This is the common mode value for most uses of OMget_obj_seq.

 

Returned value

The sequence number, or an error status code (see Return Status ).

Example 1

The V code below defines a group object:


group grp1 {
int a;
int &b => grp0.b;
};

You can determine the highest sequence number among grp1, any of its subobjects, and any objects along subobject b's chain of references:


OMobj_id grp1_id;
int seq;

...
seq = OMget_obj_seq(grp1_id, OMnull_obj, OM_SEQ_VAL);

Example 2

This example illustrates the use of template_id .

The V code below defines two groups:


group g1 {
int a, b;
};

g1 g2 {
int c, d;
};

Group g2 has four subobjects: c, d, and the two objects it inherited from g1, a, and b.

The following code segment determines the largest sequence number among group g2and its subobjects, but only considers subobjects a and b:


OMobj_id g1_id, g2_id;
int seq;
...
seq = OMget_obj_seq(g2_id, g1_id, OM_SEQ_VAL);