ns3::rapidnet::Relation Class Reference
[RapidNet Library]

A database relation with key attributes defined. More...

#include <relation.h>

Inheritance diagram for ns3::rapidnet::Relation:

Inheritance graph
[legend]
Collaboration diagram for ns3::rapidnet::Relation:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual TypeId GetInstanceTypeId ()
virtual void AddKeyAttribute (attrdeftype attrdef)
 Adds a key attribute to the schema.
virtual Ptr< TupleGetKey (Ptr< Tuple > tuple)
 Verifies if the tuple has all the key attributes of the given type and returns the key attributes as a Tuple.
virtual bool KeyExists (Ptr< Tuple > tupleKey)
 Returns true if a tuple with the given key exists in the relation.
virtual Ptr< TupleGetTupleForKey (Ptr< Tuple > tupleKey)
 Returns the tuple corresponding to the given key in the relation.
virtual int Insert (Ptr< Tuple > tuple)
 Adds a tuple to the relation.
virtual void Delete (Ptr< Tuple > tuple)
 Deletes a tuple from the relation.
virtual list< Ptr< Tuple > > GetAllTuples ()
 Returns all the tuples as a list.
virtual uint32_t Count ()
 Returns the number of tuples in the relation.

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Object.
static Ptr< RelationNew (string name)
 Factory method to create a new relation with the given name.

Protected Attributes

map< string, ValueTypeIdm_keyAttributes
 Map of key attributes.
TupleMap m_tuples
 Map of tuples against key attributes.


Detailed Description

A database relation with key attributes defined.

The RapidNet

See also:
Database contains relations of this type. It maps tuples by their keys. Methods

AddKeyAttribute() and

AddKeyAttributes() are used to define the keys. A key Attribute is defined by the name and type of the Attribute. A relation must have at least one key Attribute. All tuples inserted must have those attributes of matching types and any other additional attributes.

Usually, tuples in a relation will have the same set of non-key attributes as well. But there is no way to enforce this. The schema of the relation is defined only by the name and type of the key attributes.

Implementation note: This class maintains a map in which the value is the tuple and the key is another tuple that is contains only the key attributes of the corresponding tuple.


Member Function Documentation

virtual TypeId ns3::rapidnet::Relation::GetInstanceTypeId (  )  [inline, virtual]

Returns:
the TypeId associated to the most-derived type of this instance.
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Reimplemented from ns3::rapidnet::RelationBase.

References GetTypeId().

static TypeId ns3::rapidnet::Relation::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::Object.

No Attributes defined for this type.
No TraceSources defined for this type.

Reimplemented from ns3::rapidnet::RelationBase.

Referenced by GetInstanceTypeId().


The documentation for this class was generated from the following file:

Generated on Fri Apr 9 15:01:12 2010 for NS-3 by  doxygen 1.5.8