tecplot::toolbox::Set Class Reference

#include <Set.h>


Detailed Description

Set should be used with TecUtil functions that use the Set_pa type.

Some TecUtil functions allocate a Set_pa in which case you will need to use TecUtilSetDealloc to free the memory.

Public Member Functions

 Set ()
 Create a Set object.
 Set (SetIndex_t member)
 Create a Set object.
 Set (std::string strValue)
 Create a Set object.
 Set (std::set< int > const &stdSet)
 Create a Set object from a std::set<int>.
 Set (Set_pa set)
 Create a Set object.
 Set (const Set &set)
 Create a Set object.
virtual ~Set ()
virtual bool operator== (const Set &rhs) const
 Query if the set contains the same members as the specified set.
virtual bool operator!= (const Set &rhs) const
 Query if the set is different from the specified set.
virtual Setoperator= (SetIndex_t rhs)
 Assign a single member to the Set.
virtual Setoperator= (const Set &rhs)
 Copy the members of one set to the set.
virtual Setoperator= (const std::string rhs)
 Assign set members from a string representation of a set.
virtual Setoperator+= (SetIndex_t rhs)
 Add a member to the set.
virtual Setoperator+= (const Set &rhs)
 Add the members of one set to the set.
virtual Setoperator+= (const std::string rhs)
 Add set members from a string representation of a set.
virtual Setoperator-= (SetIndex_t member)
 Remove a member from the set.
virtual Setoperator-= (const Set &rhs)
 Remove the members of one set from the set.
virtual Setoperator-= (const std::string rhs)
 Remove set members from a string representation of a set.
virtual void add (SetIndex_t member)
 Add a member to the set.
virtual void add (const Set &set)
 Add the members of one set to the set.
virtual void remove (SetIndex_t member)
 Remove a member from the set.
virtual void remove (const Set &set)
 Remove the members of one set from the set.
virtual void clear ()
 Remove all members from the set.
virtual void assign (const Set &set)
 Copy the members of one set to the set.
virtual void assign (std::string strValue)
 Assign set members from a string representation of a set.
virtual void toStdSet (std::set< int > &stdSet)
 Create a std::set<int> representation of the set contents.
virtual std::string toString () const
 Create a string representation of the set contents.
virtual Set_pa getRef () const
 Get a reference to the Set_pa that is attached to the Set object.
virtual SetIndex_t get (SetIndex_t position) const
 Get the member at the specified position in the set.
virtual SetIndex_t size () const
 Get the number of members in the set.
virtual SetIndex_t getNext (SetIndex_t member) const
 Get the next member in the set.
virtual SetIndex_t getPosition (SetIndex_t member) const
 Get the position of the member within the set.
virtual bool isEmpty () const
 Query if the set has any members.
virtual bool isEqual (const Set &other) const
 Query if the set contains the same member as the specified set.
virtual bool isMember (SetIndex_t member) const
 Query if a member is a part of the set.
virtual bool isValidMember (SetIndex_t member) const
 Determine if a member number is valid.
virtual bool isValidPosition (SetIndex_t position) const
 Determine if a position index is valid.

Static Public Member Functions

static Set intersection (const Set &set1, const Set &set2)
 Calculate the intersection of two sets.


Constructor & Destructor Documentation

tecplot::toolbox::Set::Set (  )  [explicit]

Create a Set object.

Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.

tecplot::toolbox::Set::Set ( SetIndex_t  member  )  [explicit]

Create a Set object.

Parameters:
member The value with which to seed the Set object.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.

tecplot::toolbox::Set::Set ( std::string  strValue  )  [explicit]

Create a Set object.

Parameters:
strValue strValue must have the form: "[s[,s][,s]...]" where s can be one of: 'n' or 'n-m' or 'n-m:l' And where: n >= 1 m > n l >= 1 (l is a skip factor) e.g. "[1,4,7]" - 1,4,7 "[1-5]" - 1,2,3,4,5 "[1,4,7-13:2]" - 1,4,7,9,11,13
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.
InvalidArgumentException InvalidArgumentException is thrown if strValue does not conform to the specified rules.
See also:
Set::assign, Set::toString

tecplot::toolbox::Set::Set ( std::set< int > const &  stdSet  )  [explicit]

Create a Set object from a std::set<int>.

Parameters:
stdSet std::set<int> object
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.
InvalidArgumentException InvalidArgumentException is thrown if stdSet contains items that are not valid set members. See isValidMember() for more info.
See also:
Set::assign, Set::toString

tecplot::toolbox::Set::Set ( Set_pa  set  )  [explicit]

Create a Set object.

Parameters:
set A preallocated Set_pa with which, to populate the Set object. If this parameter is NULL an empty Set will be created.
   Set_pa zoneSet;
   TecUtilZoneGetEnabled(&zoneSet);
   Set enabledZones(zoneSet);
   TecUtilSetDealloc(&zoneSet);
   ... do something with enabledZones ...

Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.
See also:
TecUtilZoneGetEnabled, TecUtilZoneGetActive

tecplot::toolbox::Set::Set ( const Set set  ) 

Create a Set object.

Parameters:
set A Set object you want to copy
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be allocated.

virtual tecplot::toolbox::Set::~Set (  )  [virtual]


Member Function Documentation

virtual bool tecplot::toolbox::Set::operator== ( const Set rhs  )  const [virtual]

Query if the set contains the same members as the specified set.

Parameters:
rhs The set on the right hand side to compare with
Returns:
true if the set contains exactly the same members as the specified set. false otherwise.
See also:
isEqual

virtual bool tecplot::toolbox::Set::operator!= ( const Set rhs  )  const [virtual]

Query if the set is different from the specified set.

Parameters:
rhs The set on the right hand side to compare with
Returns:
true if the sets are different. false otherwise.
See also:
isEqual

virtual Set& tecplot::toolbox::Set::operator= ( SetIndex_t  rhs  )  [virtual]

Assign a single member to the Set.

Parameters:
rhs A SetIndex_t which is greater than or equal to 1.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual Set& tecplot::toolbox::Set::operator= ( const Set rhs  )  [virtual]

Copy the members of one set to the set.

Parameters:
rhs A set object that contains zero or more members
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual Set& tecplot::toolbox::Set::operator= ( const std::string  rhs  )  [virtual]

Assign set members from a string representation of a set.

Parameters:
rhs As string that represents a valid set. See Set::assign.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.
InvalidArgumentException InvalidArgumentException is thrown if strValue does not conform to the specified rules.
See also:
Set::assign, Set::toString

virtual Set& tecplot::toolbox::Set::operator+= ( SetIndex_t  rhs  )  [virtual]

Add a member to the set.

Parameters:
rhs Member to add to the set. Member must be greater than or equal to 1.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual Set& tecplot::toolbox::Set::operator+= ( const Set rhs  )  [virtual]

Add the members of one set to the set.

Parameters:
rhs The set which to add to the current set.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual Set& tecplot::toolbox::Set::operator+= ( const std::string  rhs  )  [virtual]

Add set members from a string representation of a set.

Parameters:
rhs As string that represents a valid set. See Set::assign.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.
InvalidArgumentException InvalidArgumentException is thrown if strValue does not conform to the specified rules.
See also:
Set::assign, Set::toString

virtual Set& tecplot::toolbox::Set::operator-= ( SetIndex_t  member  )  [virtual]

Remove a member from the set.

Parameters:
member Member to remove from the set.

virtual Set& tecplot::toolbox::Set::operator-= ( const Set rhs  )  [virtual]

Remove the members of one set from the set.

Parameters:
rhs The set identifying the members to remove from the current set.

virtual Set& tecplot::toolbox::Set::operator-= ( const std::string  rhs  )  [virtual]

Remove set members from a string representation of a set.

Parameters:
rhs As string that represents a valid set. See Set::assign.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if there is not enough memory to perform this operation.
InvalidArgumentException InvalidArgumentException is thrown if strValue does not conform to the specified rules.
See also:
Set::assign, Set::toString

virtual void tecplot::toolbox::Set::add ( SetIndex_t  member  )  [virtual]

Add a member to the set.

Parameters:
member Member to add to the set. Member must be greater than or equal to 1.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual void tecplot::toolbox::Set::add ( const Set set  )  [virtual]

Add the members of one set to the set.

Parameters:
set The set which to add to the current set.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual void tecplot::toolbox::Set::remove ( SetIndex_t  member  )  [virtual]

Remove a member from the set.

Parameters:
member Member to remove from the set.

virtual void tecplot::toolbox::Set::remove ( const Set set  )  [virtual]

Remove the members of one set from the set.

Parameters:
set The set which to remove the members from the current set.

virtual void tecplot::toolbox::Set::clear (  )  [virtual]

Remove all members from the set.

virtual void tecplot::toolbox::Set::assign ( const Set set  )  [virtual]

Copy the members of one set to the set.

Parameters:
set A set object that contains zero or more members
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.

virtual void tecplot::toolbox::Set::assign ( std::string  strValue  )  [virtual]

Assign set members from a string representation of a set.

Parameters:
strValue strValue must have the form: "[s[,s][,s]...]" where s can be one of: 'n' or 'n-m' or 'n-m:l' And where: n >= 1 m > n l >= 1 (l is a skip factor) e.g. "[1,4,7]" - 1,4,7 "[1-5]" - 1,2,3,4,5 "[1,4,7-13:2]" - 1,4,7,9,11,13
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the Set could not be expanded.
InvalidArgumentException InvalidArgumentException is thrown if strValue does not conform to the specified rules.
See also:
Set::toString

virtual void tecplot::toolbox::Set::toStdSet ( std::set< int > &  stdSet  )  [virtual]

Create a std::set<int> representation of the set contents.

Parameters:
stdSet std set<int> to which the memeber of the set will be assigned.
See also:
Set::assign

virtual std::string tecplot::toolbox::Set::toString (  )  const [virtual]

Create a string representation of the set contents.

The resulting string will be in the form as described by Set::assign(std::string strValue).

Returns:
A string representation of the set contents.
See also:
Set::assign

virtual Set_pa tecplot::toolbox::Set::getRef (  )  const [virtual]

Get a reference to the Set_pa that is attached to the Set object.

Returns:
A reference to the Set_pa owned by the Set object. This reference must not be deallocated.

virtual SetIndex_t tecplot::toolbox::Set::get ( SetIndex_t  position  )  const [virtual]

Get the member at the specified position in the set.

Parameters:
position The position in the set. position must be >= 1.
Returns:
The member at the specified position. If a member does not exist at the specified position the return value is TECUTILSETNOTMEMBER

virtual SetIndex_t tecplot::toolbox::Set::size (  )  const [virtual]

Get the number of members in the set.

Returns:
The count of the number of member in the set.

virtual SetIndex_t tecplot::toolbox::Set::getNext ( SetIndex_t  member  )  const [virtual]

Get the next member in the set.

Parameters:
member The member after which to return the next member. Use TECUTILSETNOTMEMBER to get the first member of the set.
Returns:
The member in the set following the specified member. If the specified member is not found or is the last member of the set, the return value is TECUTILSETNOTMEMBER
See also:
TecUtilSetForEachMember

virtual SetIndex_t tecplot::toolbox::Set::getPosition ( SetIndex_t  member  )  const [virtual]

Get the position of the member within the set.

Parameters:
member The member for which to get the position.
Returns:
The position of the specified member. If the member is not found, the return value will be TECUTILSETNOTMEMBER

static Set tecplot::toolbox::Set::intersection ( const Set set1,
const Set set2 
) [static]

Calculate the intersection of two sets.

Parameters:
set1 The first Set to use
set2 The second Set to use
Returns:
A Set containing the intersection of the two Sets.
Exceptions:
OutOfMemoryException OutOfMemoryException is thrown if the resulting Set could not be created.

virtual bool tecplot::toolbox::Set::isEmpty (  )  const [virtual]

Query if the set has any members.

Returns:
Returns true if the set has no members, false if the set contains members

virtual bool tecplot::toolbox::Set::isEqual ( const Set other  )  const [virtual]

Query if the set contains the same member as the specified set.

Parameters:
other The other set to compare with.
Returns:
true if the set contains exactly the same members as the specified set. false otherwise.

virtual bool tecplot::toolbox::Set::isMember ( SetIndex_t  member  )  const [virtual]

Query if a member is a part of the set.

Parameters:
member The member to look for in the set. member must be >= 1
Returns:
true if the member is contained in the set. false otherwise.

virtual bool tecplot::toolbox::Set::isValidMember ( SetIndex_t  member  )  const [inline, virtual]

Determine if a member number is valid.

Returns:
true if the member number is valid, false otherwise.

virtual bool tecplot::toolbox::Set::isValidPosition ( SetIndex_t  position  )  const [inline, virtual]

Determine if a position index is valid.

Returns:
true if the position index is valid, false otherwise


Generated on Tue Mar 12 02:24:47 2013 for Tecplot by  doxygen 1.5.5