CMS 3D CMS Logo

Classes | Public Member Functions | Public Attributes

DataStructs Class Reference

#include <DataStructs.h>

List of all members.

Classes

struct  Color
struct  TestStruct

Public Member Functions

 DataStructs ()
 DataStructs (int payloadID)
bool operator!= (const DataStructs &ref) const
bool operator== (const DataStructs &ref) const

Public Attributes

std::vector< int > testIntVector
std::pair< std::string, int > testPair
std::set< char > testSet
std::list< std::string > testStringList
std::vector< std::string > testStringVector
TestStruct testStruct
std::map< std::string,
std::vector< Color > > 
testTripletMap
Color tmpColor

Detailed Description

Definition at line 17 of file DataStructs.h.


Constructor & Destructor Documentation

DataStructs::DataStructs ( )

Definition at line 54 of file DataStructs.cc.

{}
DataStructs::DataStructs ( int  payloadID)

Definition at line 2 of file DataStructs.cc.

References DataStructs::Color::b, DataStructs::Color::g, i, DataStructs::Color::r, SVSIZE, testIntVector, testSet, testStringVector, testStruct, DataStructs::TestStruct::testStructInt, DataStructs::TestStruct::testStructString, testTripletMap, tmpColor, and VSIZE.

                                      :
        //testCharArray(),
        //testIntArray(),
        testStruct(),
        testTripletMap(),
        //testTripletHashMap(),
        testStringList(),
        //testTestTypedefQueue(),
        //testCrope(RSIZE, 'a'),
        //testDeque(QSIZE, 'a'),
        testPair("payloadID", payloadID),
        testSet(),
        //testString(""),
        testStringVector(),
        testIntVector()
{
        std::stringstream st;
        st << payloadID;
        tmpColor.r = payloadID;
        tmpColor.g = payloadID;
        tmpColor.b = payloadID;
        testTripletMap["DATA"].push_back(tmpColor);
        //testTripletHashMap["YELLOW"].push_back(tmpColor);
        // testTripletHashMap["WHITE"].push_back(tmpColor);
        // testStringList.push_back("Last");
        // testStringList.push_front("First");
        // testStringList.insert(++testStringList.begin(), "Middle");
        
        // for(int i =0; i<QSIZE; i++)
        // {
                // testTestTypedefQueue.push(i);
        // }
        //testDeque.push_back("Last");
        //testDeque.push_front("First");
        testSet.insert((payloadID % 10) + 48);
        // for(int i=0; i<INTSIZE; i++)
        // {
                // testIntArray[i] = i;
        // }
                // for(int i=0; i<CHSIZE; i++)
        // {
                // testCharArray[i] = (payloadID % 10) + 48;
        // }
        testStringVector.reserve(VSIZE);
        for(int i=0; i<SVSIZE; i++)
        {
                testStringVector.push_back(st.str());
                testIntVector.push_back(i);
        }
        testStruct.testStructString = st.str();
        testStruct.testStructInt = payloadID;
}

Member Function Documentation

bool DataStructs::operator!= ( const DataStructs ref) const

Definition at line 133 of file DataStructs.cc.

References operator==().

{
        return !operator==(ref);
}
bool DataStructs::operator== ( const DataStructs ref) const

Definition at line 56 of file DataStructs.cc.

References compare_using_db::compare, i, SVSIZE, testIntVector, testPair, testSet, testStringList, testStringVector, testStruct, DataStructs::TestStruct::testStructInt, DataStructs::TestStruct::testStructString, testTripletMap, and VSIZE.

Referenced by operator!=().

{
        // for(int i =0; i<CHSIZE; i++)
        // {
                // if(testCharArray[i] != ref.testCharArray[i])
                // {
                        // std::cout<<i<<"fail"<<std::endl;
                        // std::cout<<testCharArray[i]<<" != "<<ref.testCharArray[i]<<std::endl;
                        // return false;
                // }
        // }
        // for(int i =0; i<INTSIZE; i++)
        // {
                // if(testIntArray[i] != ref.testIntArray[i])
                // {
                        // std::cout<<i<<"fail"<<std::endl;
                        // std::cout<<testIntArray[i]<<" != "<<ref.testIntArray[i]<<std::endl;
                        // return false;
                // }
        // }
        if(testTripletMap != ref.testTripletMap)
        {
                return false;
        }
        // if(testTripletHashMap != ref.testTripletHashMap)
        // {
                // return false;
        // }
        if(testStringList != ref.testStringList)
        {
                return false;
        }
        // if(testTestTypedefQueue != ref.testTestTypedefQueue)
        // {
                // return false;
        // }
        // if(testCrope != ref.testCrope)
        // {
                // return false;
        // }
        // if(testDeque != ref.testDeque)
        // {
                // return false;
        // }
        if(testPair != ref.testPair)
        {
                return false;
        }
        if(testSet != ref.testSet)
        {
                return false;
        }
        for(int i=0; i<VSIZE; i++)
        {
                if(testStringVector[i].compare(ref.testStringVector[i]) != 0)
                {
                        return false;
                }
        }
        for(int i=0; i<SVSIZE; i++)
        {
                if(testIntVector != ref.testIntVector)
                {
                        return false;
                }
        }
        if(testStruct.testStructString.compare(ref.testStruct.testStructString) != 0)
        {
                return false;
        }
        if(testStruct.testStructInt != ref.testStruct.testStructInt)
        {
                return false;
        }
        return true;
}

Member Data Documentation

std::vector<int> DataStructs::testIntVector

Definition at line 65 of file DataStructs.h.

Referenced by DataStructs(), TestPayloadClass::DataToFile(), and operator==().

std::pair<std::string, int> DataStructs::testPair

Definition at line 62 of file DataStructs.h.

Referenced by TestPayloadClass::DataToFile(), and operator==().

std::set<char> DataStructs::testSet

Definition at line 63 of file DataStructs.h.

Referenced by DataStructs(), and operator==().

std::list<std::string> DataStructs::testStringList

Definition at line 55 of file DataStructs.h.

Referenced by TestPayloadClass::DataToFile(), and operator==().

std::vector<std::string> DataStructs::testStringVector

Definition at line 64 of file DataStructs.h.

Referenced by DataStructs(), TestPayloadClass::DataToFile(), and operator==().

Definition at line 51 of file DataStructs.h.

Referenced by DataStructs(), and operator==().

std::map<std::string, std::vector<Color> > DataStructs::testTripletMap

Definition at line 53 of file DataStructs.h.

Referenced by DataStructs(), TestPayloadClass::DataToFile(), and operator==().

Definition at line 52 of file DataStructs.h.

Referenced by DataStructs().