ct_common
1.0.1
Common library for combinatorial testing
|
00001 //===----- ct_common/common/tuple.h -----------------------------*- 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 header file contains the class for tuples 00010 // 00011 //===----------------------------------------------------------------------===// 00012 00013 #ifndef CT_COMMON_TUPLE_H_ 00014 #define CT_COMMON_TUPLE_H_ 00015 00016 #include <vector> 00017 #include <boost/shared_ptr.hpp> 00018 #include <ct_common/common/utils.h> 00019 #include <ct_common/common/pvpair.h> 00020 #include <ct_common/common/assignment.h> 00021 00022 namespace ct { 00023 namespace common { 00024 class ParamSpec; 00028 class DLL_EXPORT Tuple : public Assignment, private std::vector<PVPair> 00029 { 00030 public: 00031 Tuple(void); 00032 Tuple(const Tuple &from); 00033 explicit Tuple(const std::vector<PVPair> &from); 00034 Tuple &operator =(const Tuple &right); 00035 ~Tuple(void); 00036 00037 virtual bool IsContainParam(std::size_t pid) const; 00038 virtual std::size_t GetValue(std::size_t pid) const; 00039 virtual bool IsSubAssignmentOf(const Assignment &asignment) const; 00040 00042 std::vector<std::size_t> get_rel_pids(void) const; 00043 00045 void Sort(void); 00046 00049 const PVPair *Search(std::size_t pid) const; 00050 00052 bool to_the_next_tuple( 00053 std::vector<boost::shared_ptr<ct::common::ParamSpec> > param_specs); 00055 bool to_the_next_tuple_with_ivld( 00056 std::vector<boost::shared_ptr<ct::common::ParamSpec> > param_specs); 00057 00058 using std::vector<PVPair>::assign; 00059 using std::vector<PVPair>::push_back; 00060 using std::vector<PVPair>::pop_back; 00061 using std::vector<PVPair>::resize; 00062 using std::vector<PVPair>::size; 00063 using std::vector<PVPair>::empty; 00064 using std::vector<PVPair>::operator []; 00065 bool operator == (const Tuple &right) const; 00066 bool operator <(const Tuple &right) const; 00067 }; 00068 } // namespace common 00069 } // namespace ct 00070 00071 #endif // CT_COMMON_TUPLE_H_