OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EntryKeyDataOperationSet Class Reference

#include <EntryKeyData.hh>

Inheritance diagram for EntryKeyDataOperationSet:
Inheritance graph
Collaboration diagram for EntryKeyDataOperationSet:
Collaboration graph

Public Member Functions

 EntryKeyDataOperationSet ()
 
 EntryKeyDataOperationSet (std::set< std::string > fieldData)
 
virtual ~EntryKeyDataOperationSet ()
 
EntryKeyDatacopy () const
 
bool isEqual (const EntryKeyData *fieldData) const
 
bool isGreater (const EntryKeyData *fieldData) const
 
bool isSmaller (const EntryKeyData *fieldData) const
 
double coefficient (const EntryKeyData *data1, const EntryKeyData *data2) const
 
std::string toString () const
 
- Public Member Functions inherited from EntryKeyData
 EntryKeyData ()
 
virtual ~EntryKeyData ()
 

Private Member Functions

 EntryKeyDataOperationSet (const EntryKeyDataOperationSet &)
 Copying not allowed. More...
 
EntryKeyDataOperationSetoperator= (const EntryKeyDataOperationSet &)
 Assignment not allowed. More...
 

Private Attributes

std::set< std::string > data_
 Operation set data. More...
 

Detailed Description

Implementation for operation set type of data.

Definition at line 139 of file EntryKeyData.hh.

Constructor & Destructor Documentation

◆ EntryKeyDataOperationSet() [1/3]

EntryKeyDataOperationSet::EntryKeyDataOperationSet ( )

Default constructor.

Definition at line 357 of file EntryKeyData.cc.

357  : data_() {
358 }

Referenced by copy().

◆ EntryKeyDataOperationSet() [2/3]

EntryKeyDataOperationSet::EntryKeyDataOperationSet ( std::set< std::string >  fieldData)

Constructor.

Parameters
fieldDataA set of operations.

Definition at line 365 of file EntryKeyData.cc.

366  : data_(fieldData) {
367 }

◆ ~EntryKeyDataOperationSet()

EntryKeyDataOperationSet::~EntryKeyDataOperationSet ( )
virtual

Destructor.

Definition at line 372 of file EntryKeyData.cc.

372  {
373 }

◆ EntryKeyDataOperationSet() [3/3]

EntryKeyDataOperationSet::EntryKeyDataOperationSet ( const EntryKeyDataOperationSet )
private

Copying not allowed.

Member Function Documentation

◆ coefficient()

double EntryKeyDataOperationSet::coefficient ( const EntryKeyData data1,
const EntryKeyData data2 
) const
virtual

Cannot be called for EntryKeyDataOperationSet.

Operation sets cannot be compared and no coefficient can be counted.

Parameters
data1Nothing.
data2Nothing.
Returns
Nothing.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 449 of file EntryKeyData.cc.

450  {
451  throw WrongSubclass(__FILE__, __LINE__,
452  "EntryKeyDataOperationSet::coefficient");
453  return 0.0; // stupid return statement to keep compiler quiet
454 }

◆ copy()

EntryKeyData * EntryKeyDataOperationSet::copy ( ) const
virtual

Copies the operation set.

Client is responsible of deallocating the memory reserved for the returned object.

Returns
A copy of the operation set.

Implements EntryKeyData.

Definition at line 384 of file EntryKeyData.cc.

384  {
385  return new EntryKeyDataOperationSet(data_);
386 }

References data_, and EntryKeyDataOperationSet().

Here is the call graph for this function:

◆ isEqual()

bool EntryKeyDataOperationSet::isEqual ( const EntryKeyData fieldData) const
virtual

Checks if two operation sets are equal.

Cannot compare to other data types.

Parameters
fieldDataOperation set.
Returns
True if two operation sets are equal.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 398 of file EntryKeyData.cc.

398  {
399  EntryKeyDataOperationSet* data = dynamic_cast<EntryKeyDataOperationSet*>(
400  const_cast<EntryKeyData*>(fieldData));
401  if (data == NULL) {
402  throw WrongSubclass(__FILE__, __LINE__,
403  "EntryKeyDataOperationSet::isEqual");
404  }
405  return data_ == data->data_;
406 }

References data_.

◆ isGreater()

bool EntryKeyDataOperationSet::isGreater ( const EntryKeyData fieldData) const
virtual

Checks if another operation set is greater.

Cannot compare to other data types. Cannot compare to other operation sets and because of that returns always false.

Parameters
fieldDataOperation set.
Returns
Always false.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 419 of file EntryKeyData.cc.

419  {
420  return false;
421 }

◆ isSmaller()

bool EntryKeyDataOperationSet::isSmaller ( const EntryKeyData fieldData) const
virtual

Checks if this operation set is smaller than another set.

Cannot compare to other data types. Cannot compare to other operation sets and because of that returns always true.

Parameters
fieldDataOperation set.
Returns
Always true.
Exceptions
WrongSubclassGiven data type was illegal.

Implements EntryKeyData.

Definition at line 434 of file EntryKeyData.cc.

434  {
435  return true;
436 }

◆ operator=()

EntryKeyDataOperationSet& EntryKeyDataOperationSet::operator= ( const EntryKeyDataOperationSet )
private

Assignment not allowed.

◆ toString()

std::string EntryKeyDataOperationSet::toString ( ) const
virtual

Converts the operation set into a string.

Returns
Operation set as a string.

Implements EntryKeyData.

Definition at line 462 of file EntryKeyData.cc.

462  {
463 
464  string result = "";
465  for (std::set<string>::iterator i = data_.begin();
466  i != data_.end();
467  i++) {
468 
469  result += *i;
470  }
471  return result;
472 }

References data_.

Member Data Documentation

◆ data_

std::set<std::string> EntryKeyDataOperationSet::data_
private

Operation set data.

Definition at line 155 of file EntryKeyData.hh.

Referenced by copy(), isEqual(), and toString().


The documentation for this class was generated from the following files:
EntryKeyDataOperationSet
Definition: EntryKeyData.hh:139
EntryKeyDataOperationSet::EntryKeyDataOperationSet
EntryKeyDataOperationSet()
Definition: EntryKeyData.cc:357
EntryKeyData
Definition: EntryKeyData.hh:53
WrongSubclass
Definition: Exception.hh:336
EntryKeyDataOperationSet::data_
std::set< std::string > data_
Operation set data.
Definition: EntryKeyData.hh:155