ASSOCIATION

Section: SOS CLASS LIBRARY (3S)
Updated: 28/10/1991
Index Return to Main Contents
man2html: unable to open or read file /usr/lib/ms/ms.acc
 

NAME

Association<Entity> - predefined class Association  

SYNOPSIS

#include "<SOS>/include/agg_sos.h"

class Association<Role1, Role2> (sos_Bool role1_based_on_equal = FALSE,
                                sos_Bool role2_based_on_equal = FALSE)
   : sos_Aggregate
{
public:
            sos_Bool   is_role1 (Role1);
            sos_Bool   is_role2 (Role2);

   // ** sos_Cursor operations **
   abstract Role1      get_role1 (sos_Cursor);
   abstract Role2      get_role2 (sos_Cursor);
}
 

DESCRIPTION

The class Association<Role1,Role2> is the superclass of the predefined type Mapping<Key,Info>. Together with its superclass sos_Aggregate it provides an interface for traversing and manipulating Associations in a uniform way. Associations are basically collections of pairs, where Role1 is the type of the first element and Role2 is the type of the second element of such a pair. Some of the methods are not implemented in class Association but subclasses have to implement them. These methods are marked above as abstract.

Association::create (ct, role1_based_on_equal, role2_based_on_equal)
The create parameters role1/2_based_on_equal determine if tests for membership in the association should be based on the equality or identity of the respective entities.
is_role1 (e)
returns TRUE if e is contained in the Association as a first element of some pair, FALSE otherwise. The semantics of this function depends on the value of the role1_based_on_equal parameter provided at creation time. If (role1_based_on_equal == TRUE) then is_role1 (e) returns TRUE if there exists a first element x of some pair in this Association for which x.equal (e) holds. If (role1_based_on_equal == FALSE) then is_role1 (e) returns TRUE only if there exists a first element x of some pair in this Association, for which x.identical (e) holds.
is_role2 (e)
behaves like is_role1, but tests for the second element of a pair with respect to role2_based_on_equal.
get_role1 (c)
returns the first element from the pair at the current sos_Cursor position.

PRECONDITION: is_valid (c)

get_role2 (c)
returns the second element from the pair at the current sos_Cursor position.

PRECONDITION: is_valid (c)

 

FILES

<SOS>/src/agg/agg.sos
SOS schema file

<SOS>/src/agg/agg_sos.h
complete schema interface

<SOS>/src/agg/agg_use.h
restricted schema interface

<SOS>/src/agg/agg_ext.h
definition of iterators (automatically included by agg_use.h)

<SOS>/src/agg/Association.c
Association implementation file

<SOS>/lib/sos.a
SOS library
 

SEE_ALSO

sos_Object(3), sos_Aggregate(3), Mapping(3), sos_Cursor(3), agg_iterators(3)  

AUTHOR

Bernhard Schiefer, Dietmar Theobald


 

Index

NAME
SYNOPSIS
DESCRIPTION
FILES
SEE_ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 00:37:57 GMT, March 30, 2022