Home Libraries Author Links

Abstract Multmiap Type Example
[Dset TestAbstract Map Types ElemTypeStmMap and ElemTypeStmMultiMap]

Collaboration diagram for Abstract Multmiap Type Example:

Detailed Description

MultiNrStmMultiMap is an example of an abstract multimap type with int both as key type and as mapped type and the key comparison function keyCmp().


Files

file  MultiNrStmMultiMapDoc.h
 Documentation of the abstract multimap type MultiNrStmMultiMap.

Data Structures

struct  MultiNr
 Element type of the abstract multimap type MultiNrStmMultiMap. More...
struct  MultiNrStmMultiMapValueType
 Value type structure of an MultiNrStmMultiMap object. More...

MultiNrStmMultiMap Representation

Objects of abstract multimap type MultiNrStmMultiMap and their iterators of type MultiNrStmMultiMapIterator are represented by pointers to their implementation structures of type MultiNrStmMultiMapImpl_ and MultiNrStmMultiMapIteratorImpl_, respectively.

typedef struct
MultiNrStmMultiMapImpl_ * 
MultiNrStmMultiMap
 A valid MultiNrStmMultiMap object is represented as a pointer to its implementation structure MultiNrStmMultiMapImpl_.
typedef struct
MultiNrStmMultiMapIteratorImpl_ * 
MultiNrStmMultiMapIterator
 A valid MultiNrStmMultiMapIterator object is represented as a pointer to its implementation structure MultiNrStmMultiMapIteratorImpl_.
typedef struct MultiNr MultiNr
 Type name of the element type of the abstract multimap type MultiNrStmMultiMap.
typedef struct
MultiNrStmMultiMapValueType 
MultiNrStmMultiMapValueType
 Type name of the value type of the abstract multimap type MultiNrStmMultiMap.
#define StmMultiMapDoc_

MultiNrStmMultiMap Creation and Destruction

static MultiNrStmMultiMap MultiNrStmMultiMapCreate (void)
 Creation of a new MultiNrStmMultiMap object.
static void MultiNrStmMultiMapDestroy (MultiNrStmMultiMap ac)
 Destruction of the MultiNrStmMultiMap object ac.

MultiNrStmMultiMap Iterators

static MultiNrStmMultiMapIterator MultiNrStmMultiMapBegin (MultiNrStmMultiMap ac)
 Return an iterator to the first element of the MultiNrStmMultiMap object ac.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapEnd (MultiNrStmMultiMap ac)
 Return an iterator to one past the last element of the MultiNrStmMultiMap object ac.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapRBegin (MultiNrStmMultiMap ac)
 Return an iterator to the last element of the MultiNrStmMultiMap object ac.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapREnd (MultiNrStmMultiMap ac)
 Return an iterator to one before the first element of the MultiNrStmMultiMap object ac.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapIteratorNext (MultiNrStmMultiMapIterator iter)
 Return an iterator to the element following the one referenced by iter.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapIteratorPrev (MultiNrStmMultiMapIterator iter)
 Return an iterator to the element preceding the one referenced by iter.
static StmBool MultiNrStmMultiMapIteratorDereferenceable (MultiNrStmMultiMapIterator iter)
 Return StmTrue, if iter is dereferenceable.
static StmBool MultiNrStmMultiMapIteratorDereferencable (MultiNrStmMultiMapIterator iter)
 Return StmTrue, if iter is dereferenceable.
static
MultiNrStmMultiMapValueType
MultiNrStmMultiMapIteratorElem (MultiNrStmMultiMapIterator iter)
 Return a pointer to the MultiNrStmMultiMapValueType object accessing the element referenced by iter.
static int MultiNrStmMultiMapIteratorKey (MultiNrStmMultiMapIterator iter)
 Return the key of the element referenced by iter.
static int * MultiNrStmMultiMapIteratorVal (MultiNrStmMultiMapIterator iter)
 Return a pointer to the value mapped to by the element referenced by iter.

MultiNrStmMultiMap Capacity

static int MultiNrStmMultiMapSize (MultiNrStmMultiMap ac)
 Return the element count of the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapMaxSize (MultiNrStmMultiMap ac)
 Return the maximal possible element count of the MultiNrStmMultiMap object ac.
static StmBool MultiNrStmMultiMapEmpty (MultiNrStmMultiMap ac)
 Return StmTrue, if the MultiNrStmMultiMap object ac is empty.

MultiNrStmMultiMap Modifiers

static MultiNrStmMultiMapIterator MultiNrStmMultiMapInsert (MultiNrStmMultiMap ac, const MultiNr *elem)
 Insert the element pointed to by elem into the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapErase (MultiNrStmMultiMap ac, MultiNrStmMultiMapIterator iter)
 Erase the element referenced by iter from the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapEraseRange (MultiNrStmMultiMap ac, MultiNrStmMultiMapIterator first, MultiNrStmMultiMapIterator last)
 Erase the elements referenced by the half open interval [first, last) from the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapEraseElem (MultiNrStmMultiMap ac, const MultiNr *elem)
 Erase all elements equivalent to the element pointed to by elem from the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapEraseKey (MultiNrStmMultiMap ac, int key)
 Erase all elements designated by key from the MultiNrStmMultiMap object ac.
static int MultiNrStmMultiMapClear (MultiNrStmMultiMap ac)
 Erase all elements from the MultiNrStmMultiMap ac.

MultiNrStmMultiMap Operations

static MultiNrStmMultiMapIterator MultiNrStmMultiMapFind (MultiNrStmMultiMap ac, const MultiNr *elem)
 Find an element in the MultiNrStmMultiMap object ac equivalent to the element pointed to by elem.
static MultiNrStmMultiMapIterator MultiNrStmMultiMapFindKey (MultiNrStmMultiMap ac, int key)
 Find an element in the MultiNrStmMultiMap object ac designated by key.
static int MultiNrStmMultiMapCount (MultiNrStmMultiMap ac, const MultiNr *elem, MultiNrStmMultiMapIterator *first, MultiNrStmMultiMapIterator *last)
 Return the number of elements in the MultiNrStmMultiMap object ac being equivalent to the element pointed to by elem and optionally determine the range of the elements found.
static int MultiNrStmMultiMapCountKey (MultiNrStmMultiMap ac, int key, MultiNrStmMultiMapIterator *first, MultiNrStmMultiMapIterator *last)
 Return the number of elements in the MultiNrStmMultiMap object ac designated by key and optionally determine the range of the elements found.


Typedef Documentation

typedef struct MultiNrStmMultiMapImpl_* MultiNrStmMultiMap

A valid MultiNrStmMultiMap object is represented as a pointer to its implementation structure MultiNrStmMultiMapImpl_.

Valid objects of type MultiNrStmMultiMap can be achieved only as return values of MultiNrStmMultiMapCreate(). Moreover, variables of type MultiNrStmMultiMap may have the value NULL meaning invalid or undefined.

Examples:
dsettst.c.

Definition at line 77 of file MultiNrStmMultiMapDoc.h.

typedef struct MultiNrStmMultiMapIteratorImpl_* MultiNrStmMultiMapIterator

A valid MultiNrStmMultiMapIterator object is represented as a pointer to its implementation structure MultiNrStmMultiMapIteratorImpl_.

Valid objects of type MultiNrStmMultiMapIterator can be achieved only as return values of MultiNrStmMultiMap or MultiNrStmMultiMapIterator method functions. Moreover, variables of type MultiNrStmMultiMapIterator may have the value NULL meaning invalid or undefined.

Examples:
dsettst.c.

Definition at line 88 of file MultiNrStmMultiMapDoc.h.

typedef struct MultiNr MultiNr

Type name of the element type of the abstract multimap type MultiNrStmMultiMap.

Definition at line 101 of file MultiNrStmMultiMapDoc.h.

typedef struct MultiNrStmMultiMapValueType MultiNrStmMultiMapValueType

Type name of the value type of the abstract multimap type MultiNrStmMultiMap.

Definition at line 128 of file MultiNrStmMultiMapDoc.h.


Function Documentation

static MultiNrStmMultiMap MultiNrStmMultiMapCreate ( void   )  [static]

Creation of a new MultiNrStmMultiMap object.

Effects:
The function creates a MultiNrStmMultiMap object. This object has to be used as argument of the other MultiNrStmMultiMap functions.
Returns:
NULL on error. Then the variable errno contains the error's cause.

The MultiNrStmMultiMap object created on success.

See also:
MultiNrStmMultiMapDestroy().
Examples:
dsettst.c.

static void MultiNrStmMultiMapDestroy ( MultiNrStmMultiMap  ac  )  [static]

Destruction of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object to be destroyed.
Effects:
The function destroys the MultiNrStmMultiMap object ac. It is no error to call the function for a MultiNrStmMultiMap object with value NULL in which case the function does nothing.
See also:
MultiNrStmMultiMapCreate().
Examples:
dsettst.c.

static MultiNrStmMultiMapIterator MultiNrStmMultiMapBegin ( MultiNrStmMultiMap  ac  )  [static]

Return an iterator to the first element of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if ac is invalid in which case the variable errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if ac is valid but empty.

The MultiNrStmMultiMapIterator object referencing the first element of ac, if ac is valid and not empty.

See also:
MultiNrStmMultiMapEmpty(), MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapEnd().
Examples:
dsettst.c.

static MultiNrStmMultiMapIterator MultiNrStmMultiMapEnd ( MultiNrStmMultiMap  ac  )  [static]

Return an iterator to one past the last element of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if ac is invalid in which case the variable errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if ac is valid.

See also:
MultiNrStmMultiMapEmpty(), MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapBegin().
Examples:
dsettst.c.

static MultiNrStmMultiMapIterator MultiNrStmMultiMapRBegin ( MultiNrStmMultiMap  ac  )  [static]

Return an iterator to the last element of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if ac is invalid in which case the variable errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if ac is valid but empty.

The MultiNrStmMultiMapIterator object referencing the last element of ac, if ac is valid and not empty.

See also:
MultiNrStmMultiMapEmpty(), MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapREnd().

static MultiNrStmMultiMapIterator MultiNrStmMultiMapREnd ( MultiNrStmMultiMap  ac  )  [static]

Return an iterator to one before the first element of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if ac is invalid in which case the variable errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if ac is valid.

See also:
MultiNrStmMultiMapEmpty(), MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapRBegin().

static MultiNrStmMultiMapIterator MultiNrStmMultiMapIteratorNext ( MultiNrStmMultiMapIterator  iter  )  [static]

Return an iterator to the element following the one referenced by iter.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if iter is invalid in which case the variable errno is set to EINVAL.

MultiNrStmMultiMapBegin(ac), if iter is a valid but not dereferenceable iterator of a MultiNrStmMultiMap object ac.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if iter references the last element of a MultiNrStmMultiMap object.

The MultiNrStmMultiMapIterator object referencing the successor element of the element iter references, if iter is dereferenceable.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapBegin (), MultiNrStmMultiMapIteratorPrev().
Examples:
dsettst.c.

static MultiNrStmMultiMapIterator MultiNrStmMultiMapIteratorPrev ( MultiNrStmMultiMapIterator  iter  )  [static]

Return an iterator to the element preceding the one referenced by iter.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
The invalid MultiNrStmMultiMapIterator (NULL), if iter is invalid in which case the variable errno is set to EINVAL.

MultiNrStmMultiMapEnd(ac), if iter is a valid but not dereferenceable iterator of a MultiNrStmMultiMap object ac.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if iter references the first element of a MultiNrStmMultiMap object.

The MultiNrStmMultiMapIterator object referencing the predecessor element of the element iter references, if iter is dereferenceable.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapEnd (), MultiNrStmMultiMapIteratorNext().

static StmBool MultiNrStmMultiMapIteratorDereferenceable ( MultiNrStmMultiMapIterator  iter  )  [static]

Return StmTrue, if iter is dereferenceable.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
StmFalse, if iter is invalid (NULL), or if iter is valid but does not reference an element of a MultiNrStmMultiMap object.

StmTrue, if iter is valid and references an element of a MultiNrStmMultiMap object.

static StmBool MultiNrStmMultiMapIteratorDereferencable ( MultiNrStmMultiMapIterator  iter  )  [static]

Return StmTrue, if iter is dereferenceable.

Deprecated:
Do not use for new code. Use MultiNrStmMultiMapIteratorDereferenceable() instead.
Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
StmFalse, if iter is invalid (NULL), or if iter is valid but does not reference an element of a MultiNrStmMultiMap object.

StmTrue, if iter is valid and references an element of a MultiNrStmMultiMap object.

static MultiNrStmMultiMapValueType* MultiNrStmMultiMapIteratorElem ( MultiNrStmMultiMapIterator  iter  )  [static]

Return a pointer to the MultiNrStmMultiMapValueType object accessing the element referenced by iter.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
NULL, if iter is not dereferenceable in which case the variable errno is set to EINVAL.

A pointer to the MultiNrStmMultiMapValueType object referenced by iter, if iter is dereferenceable.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapIteratorKey (), MultiNrStmMultiMapIteratorVal ().

static int MultiNrStmMultiMapIteratorKey ( MultiNrStmMultiMapIterator  iter  )  [static]

Return the key of the element referenced by iter.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Requires:
iter is dereferenceable.
Effects:
If iter is not dereferenceable, the function calls abort() which normally terminates the calling process as if raise(SIGABRT) was called.
Returns:
A the key of the element referenced by iter, if iter is dereferenceable.
See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapIteratorElem (), MultiNrStmMultiMapIteratorVal ().
Examples:
dsettst.c.

static int* MultiNrStmMultiMapIteratorVal ( MultiNrStmMultiMapIterator  iter  )  [static]

Return a pointer to the value mapped to by the element referenced by iter.

Parameters:
[in] iter The MultiNrStmMultiMapIterator object.
Returns:
NULL, if iter is not dereferenceable in which case the variable errno is set to EINVAL.

A pointer to the value mapped by the element referenced by iter, if iter is dereferenceable.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapIteratorElem (), MultiNrStmMultiMapIteratorKey ().

static int MultiNrStmMultiMapSize ( MultiNrStmMultiMap  ac  )  [static]

Return the element count of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
-1, if ac is invalid (NULL) in which case the variable errno is set to EINVAL.

The element count of the MultiNrStmMultiMap object ac, if ac is valid.

See also:
MultiNrStmMultiMapMaxSize (), MultiNrStmMultiMapEmpty ().
Examples:
dsettst.c.

static int MultiNrStmMultiMapMaxSize ( MultiNrStmMultiMap  ac  )  [static]

Return the maximal possible element count of the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
-1, if ac is invalid (NULL) in which case the variable errno is set to EINVAL.

INT_MAX as the theoretically maximal possible element count of the MultiNrStmMultiMap object ac, if ac is valid.

See also:
MultiNrStmMultiMapSize (), MultiNrStmMultiMapEmpty ().

static StmBool MultiNrStmMultiMapEmpty ( MultiNrStmMultiMap  ac  )  [static]

Return StmTrue, if the MultiNrStmMultiMap object ac is empty.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Returns:
StmTrue, if ac is invalid (NULL) in which case the variable errno is set to EINVAL.

StmTrue, if the MultiNrStmMultiMap object ac is valid and empty.

StmFalse, if the MultiNrStmMultiMap object ac is valid and not empty.

See also:
MultiNrStmMultiMapSize (), MultiNrStmMultiMapMaxSize ().

static MultiNrStmMultiMapIterator MultiNrStmMultiMapInsert ( MultiNrStmMultiMap  ac,
const MultiNr elem 
) [static]

Insert the element pointed to by elem into the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] elem A pointer to the constant MultiNr object to be inserted.
Effects:
The function inserts a copy of the element pointed to by elem into the MultiNrStmMultiMap object ac.
Returns:
NULL on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid or elem is NULL, errno is set to EINVAL.

a MultiNrStmMultiMapIterator object referencing the element of ac which was inserted.

See also:
MultiNrStmMultiMapErase(), MultiNrStmMultiMapFind(), MultiNrStmMultiMapCount().
Examples:
dsettst.c.

static int MultiNrStmMultiMapErase ( MultiNrStmMultiMap  ac,
MultiNrStmMultiMapIterator  iter 
) [static]

Erase the element referenced by iter from the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] iter The MultiNrStmMultiMapIterator object referencing the element to be erased.
Effects:
If iter is dereferenceable, the element referenced by iter is deleted from ac.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, errno is set to EINVAL.

0, if iter is not dereferenceable and no element has been erased.

1, if iter is derefereceable and the element referenced by iter has been erased.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapInsert(), MultiNrStmMultiMapFind(), MultiNrStmMultiMapCount().
Examples:
dsettst.c.

static int MultiNrStmMultiMapEraseRange ( MultiNrStmMultiMap  ac,
MultiNrStmMultiMapIterator  first,
MultiNrStmMultiMapIterator  last 
) [static]

Erase the elements referenced by the half open interval [first, last) from the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] first The MultiNrStmMultiMapIterator object referencing the first element to be erased.
[in] last The MultiNrStmMultiMapIterator object referencing the element one past the last element to be erased.
Effects:
All elements referenced by by the half open interval [first, last) are deleted from ac.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac, first or last is invalid, or if first is not dereferenceable but last is, errno is set to EINVAL.

The number of elements having been erased.

See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapInsert(), MultiNrStmMultiMapFind(), MultiNrStmMultiMapCount().

static int MultiNrStmMultiMapEraseElem ( MultiNrStmMultiMap  ac,
const MultiNr elem 
) [static]

Erase all elements equivalent to the element pointed to by elem from the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] elem A pointer to the MultiNr object being equivalent to the elements to be erased.
Effects:
All elements equivalent to the element pointed to by elem are deleted from ac.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, or if elem is NULL, errno is set to EINVAL.

The number of elements having been erased.

See also:
MultiNrStmMultiMapInsert(), MultiNrStmMultiMapFind(), MultiNrStmMultiMapCount().

static int MultiNrStmMultiMapEraseKey ( MultiNrStmMultiMap  ac,
int  key 
) [static]

Erase all elements designated by key from the MultiNrStmMultiMap object ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] key The int object designating the elements to be erased.
Effects:
All elements designated by key are deleted from ac.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, errno is set to EINVAL.

The number of elements having been erased.

See also:
MultiNrStmMultiMapInsert(), MultiNrStmMultiMapFindKey(), MultiNrStmMultiMapCountKey().

static int MultiNrStmMultiMapClear ( MultiNrStmMultiMap  ac  )  [static]

Erase all elements from the MultiNrStmMultiMap ac.

Parameters:
[in] ac The MultiNrStmMultiMap object.
Effects:
All elements are deleted from ac.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, errno is set to EINVAL.

The number of elements having been erased.

See also:
MultiNrStmMultiMapErase(), MultiNrStmMultiMapEraseRange().
Examples:
dsettst.c.

static MultiNrStmMultiMapIterator MultiNrStmMultiMapFind ( MultiNrStmMultiMap  ac,
const MultiNr elem 
) [static]

Find an element in the MultiNrStmMultiMap object ac equivalent to the element pointed to by elem.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] elem A pointer to the MultiNr object being equivalent to the element to be found.
Effects:
The function looks for an element contained in ac being equivalent to the element pointed to by elem.
Returns:
NULL on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, or if elem is NULL, errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if no element equivalent to the element pointed to by elem is contained in ac.

A MultiNrStmMultiMapIterator object referencing an element equivalent to the element pointed to by elem contained in ac.

Note:
If more than one element equivalent to the element pointed to by elem is contained in ac, it is unspecified which one of them is referenced by the MultiNrStmMultiMapIterator object returned. If that is an issue, consider to use MultiNrStmMultiMapCount() instead.
See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapInsert(), MultiNrStmMultiMapErase(), MultiNrStmMultiMapCount().

static MultiNrStmMultiMapIterator MultiNrStmMultiMapFindKey ( MultiNrStmMultiMap  ac,
int  key 
) [static]

Find an element in the MultiNrStmMultiMap object ac designated by key.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] key The int object designating the element to be found.
Effects:
The function looks for an element contained in ac being designated by key.
Returns:
NULL on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, errno is set to EINVAL.

A valid but not dereferenceable MultiNrStmMultiMapIterator object, if no element designated by key is contained in ac.

A MultiNrStmMultiMapIterator object referencing an element designated by key contained in ac.

Note:
If more than one element designated by key is contained in ac, it is unspecified which one of them is referenced by the MultiNrStmMultiMapIterator object returned. If that is an issue, consider to use MultiNrStmMultiMapCountKey() instead.
See also:
MultiNrStmMultiMapIteratorDereferenceable(), MultiNrStmMultiMapInsert(), MultiNrStmMultiMapEraseKey(), MultiNrStmMultiMapCountKey().
Examples:
dsettst.c.

static int MultiNrStmMultiMapCount ( MultiNrStmMultiMap  ac,
const MultiNr elem,
MultiNrStmMultiMapIterator first,
MultiNrStmMultiMapIterator last 
) [static]

Return the number of elements in the MultiNrStmMultiMap object ac being equivalent to the element pointed to by elem and optionally determine the range of the elements found.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] elem A pointer to the MultiNr object being equivalent to the elements to be found.
[out] first If not NULL, the address of the MultiNrStmMultiMapIterator object expected to reference the first element found.
[out] last If not NULL, the address of the MultiNrStmMultiMapIterator object expected to reference the element one past the last element found.
Effects:
The function looks for all elements contained in ac being equivalent to the element pointed to by elem and updates the MultiNrStmMultiMapIterator objects first and last accordingly, if applicable.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, or if elem is NULL, errno is set to EINVAL.

The number of elements equivalent to the element pointed to by elem contained in ac.

See also:
MultiNrStmMultiMapInsert(), MultiNrStmMultiMapErase(), MultiNrStmMultiMapFind().

static int MultiNrStmMultiMapCountKey ( MultiNrStmMultiMap  ac,
int  key,
MultiNrStmMultiMapIterator first,
MultiNrStmMultiMapIterator last 
) [static]

Return the number of elements in the MultiNrStmMultiMap object ac designated by key and optionally determine the range of the elements found.

Parameters:
[in] ac The MultiNrStmMultiMap object.
[in] key The int object designating the elements to be found.
[out] first If not NULL, the address of the MultiNrStmMultiMapIterator object expected to reference the first element found.
[out] last If not NULL, the address of the MultiNrStmMultiMapIterator object expected to reference the element one past the last element found.
Effects:
The function looks for all elements contained in ac designated by key and updates the MultiNrStmMultiMapIterator objects first and last accordingly, if applicable.
Returns:
-1 on error. Then the variable errno reflects the error's cause. Especially, if ac is invalid, errno is set to EINVAL.

The number of elements designated by key contained in ac.

See also:
MultiNrStmMultiMapInsert(), MultiNrStmMultiMapEraseKey(), MultiNrStmMultiMapFindKey().


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).