type_spec : 'index' '<' simple_type_spec ',' simple_type_spec '>'
Attributes can be indexes; these are called ``manual indexes'', meaning that they are explicitly intialized, loaded, and manipulated by an application program.
typedef long ssn; // social security number interface Person { public: attribute string name; attribute ssn social_security_number; }; interface IndexObject { public: attribute index<string,Person> name_to_person; attribute index<ssn,string> ssn_to_name; };
The index
declaration
index<string,Person>
is equivalent to
index<string,ref<Person> >; the
two declaration styles can be used interchangeably.