// StreamType_t.cxx #include "StreamType.h" using hes::EdoType; using hes::EdoKey; using hes::PlacementCategoryType; using hes::StreamType; int main() { string line = "--------------------------------------"; cout << line << endl; EdoType t1(1); EdoType t2(2); EdoKey k1("one"); EdoKey k2("two"); { StreamType st; cout << st << endl; assert( ! st.is_valid() ); cout << line << endl; } StreamType::PCList pcs; { StreamType st("MyStream", pcs); cout << st << endl; assert( ! st.is_valid() ); cout << line << endl; } { PlacementCategoryType pct("pct1"); pct.insert(t1,k1); pct.close(); cout << pct << endl; pcs.push_back(pct); cout << line << endl; } { StreamType st("", pcs); cout << st << endl; assert( ! st.is_valid() ); cout << line << endl; } { StreamType st("mystream", pcs); cout << st << endl; assert( st.is_valid() ); assert( st.size() == 1 ); cout << line << endl; } { PlacementCategoryType pct("pct2"); pct.insert(t2,k2); pct.close(); cout << pct << endl; pcs.push_back(pct); cout << line << endl; } { StreamType st("mystream", pcs); cout << st << endl; assert( st.is_valid() ); assert( st.size() == 2 ); cout << line << endl; } { StreamType st1("mystream", pcs); StreamType st2("mystream", pcs); PlacementCategoryType pct("pct12"); pct.insert(t1,k1); pct.close(); pcs.push_back(pct); StreamType st3("mystream", pcs); cout << st1 << endl; cout << st2 << endl; cout << st3 << endl; assert( st1.is_valid() ); assert( st2.is_valid() ); assert( st3.is_valid() ); assert( st1 == st2 ); assert( st1 != st3 ); cout << line << endl; } return 0; }