ct_common  1.0.1
Common library for combinatorial testing
src/ct_common/common/tuplepool.cpp
Go to the documentation of this file.
00001 //===----- ct_common/common/tuplepool.cpp -----------------------*- C++ -*-===//
00002 //
00003 //                      The ct_common Library
00004 //
00005 // This file is distributed under the MIT license. See LICENSE for details.
00006 //
00007 //===----------------------------------------------------------------------===//
00008 //
00009 // This file contains the function definitions of class TuplePool
00010 //
00011 //===----------------------------------------------------------------------===//
00012 
00013 
00014 #include <ct_common/common/tuplepool.h>
00015 
00016 using namespace ct::common;
00017 
00018 TuplePool::TuplePool(void)
00019     : tuple_set_() {
00020 }
00021 
00022 TuplePool::TuplePool(const TuplePool& from)
00023     : tuple_set_(from.tuple_set_) {
00024 }
00025 
00026 TuplePool& TuplePool::operator = (const TuplePool& right) {
00027   this->tuple_set_ = right.tuple_set_;
00028   return *this;
00029 }
00030 
00031 TuplePool::~TuplePool(void) {
00032 }
00033 
00034 bool TuplePool::query(const Tuple &tuple) {
00035   std::set<Tuple>::iterator iter = this->tuple_set_.find(tuple);
00036   if (iter == this->tuple_set_.end()) {
00037     return false;
00038   }
00039   return true;
00040 }
00041 
00042 void TuplePool::add(const Tuple &tuple) {
00043   this->tuple_set_.insert(tuple);
00044 }
00045 
00046 void TuplePool::remove(const Tuple &tuple) {
00047   this->tuple_set_.erase(tuple);
00048 }
00049 
00050 std::size_t TuplePool::size(void) const {
00051   return this->tuple_set_.size();
00052 }
00053 
00054 const std::set<Tuple> &TuplePool::getTuples(void) const {
00055   return this->tuple_set_;
00056 }
00057 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines