VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBDatasetInfo.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
11 
12 #pragma once
13 #include <utility>
14 #include <sstream>
15 #include <iostream>
16 #include <iomanip>
17 #include <boost/tuple/tuple.hpp>
18 #include <boost/tuple/tuple_comparison.hpp>
19 
20 namespace makVrv { namespace oe { namespace CDB
21 {
24  {
25  public:
26 
29  myDataset(0),
32  {
33  setStr();
34  };
36  DatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2) :
37  myDataset(Dataset),
38  myComponentSelector1(ComponentSelector1),
39  myComponentSelector2(ComponentSelector2)
40  {
41  setStr();
42  };
43 
45  friend bool operator< (const DatasetInfo& lhs, const DatasetInfo& rhs)
46  {
47  return boost::tie(lhs.myDataset, lhs.myComponentSelector1, lhs.myComponentSelector2)
48  < boost::tie(rhs.myDataset, rhs.myComponentSelector1, rhs.myComponentSelector2); // keep the same order
49  }
51  friend bool operator== (const DatasetInfo& lhs, const DatasetInfo& rhs)
52  {
53  if (lhs.getDataset() == rhs.getDataset())
54  {
56  {
58  {
59  return true;
60  }
61  }
62  }
63  return false;
64  }
65 
67  std::string str() const { return myStringRepresentation; };
69  void setDatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
70  {
71  myDataset = Dataset;
72  myComponentSelector1 = ComponentSelector1;
73  myComponentSelector2 = ComponentSelector2;
74  setStr();
75  };
77  void setDataset(int dataset) { myDataset = dataset; };
79  int getDataset() const { return myDataset; };
84 
85  private:
86 
88  void setStr()
89  {
90  std::stringstream format_stream_2;
91  format_stream_2 << "[D" << std::setfill('0') << std::setw(3) << myDataset; // dataset code
92  format_stream_2 << "_S" << std::setfill('0') << std::setw(3) << myComponentSelector1; // Component Selector 1
93  format_stream_2 << "_T" << std::setfill('0') << std::setw(3) << myComponentSelector2; // Component Selector 2
94  format_stream_2 << "]";
95  myStringRepresentation = format_stream_2.str();
96  };
97 
99  int myDataset;
106  };
107 } } } // namespace makVrv::oe::CDB
std::string myStringRepresentation
CDB Dataset string information representation (Dxxx_Sxxx_Txxx)
Definition: DtCDBDatasetInfo.h:105
DatasetInfo()
CTOR.
Definition: DtCDBDatasetInfo.h:28
int getDataset() const
Return the CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:79
int myComponentSelector1
CDB component selector 1 (Sxxx)
Definition: DtCDBDatasetInfo.h:101
std::string str() const
Return the string representation of this dataset.
Definition: DtCDBDatasetInfo.h:67
void setDataset(int dataset)
Set the CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:77
DatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
CTOR.
Definition: DtCDBDatasetInfo.h:36
int getComponentSelector1() const
Return the CDB component selector 1 (Sxxx)
Definition: DtCDBDatasetInfo.h:81
CDB Dataset information class.
Definition: DtCDBDatasetInfo.h:23
void setStr()
Get the string representation of this dataset.
Definition: DtCDBDatasetInfo.h:88
int myComponentSelector2
CDB component selector 2 (Txxx)
Definition: DtCDBDatasetInfo.h:103
friend bool operator<(const DatasetInfo &lhs, const DatasetInfo &rhs)
Smaller than operator for the Dataset Info class.
Definition: DtCDBDatasetInfo.h:45
void setDatasetInfo(int Dataset, int ComponentSelector1, int ComponentSelector2)
Change the dataset information.
Definition: DtCDBDatasetInfo.h:69
int getComponentSelector2() const
Return the CDB component selector 2 (Txxx)
Definition: DtCDBDatasetInfo.h:83
friend bool operator==(const DatasetInfo &lhs, const DatasetInfo &rhs)
== than operator for the Dataset Info class
Definition: DtCDBDatasetInfo.h:51
int myDataset
CDB dataset code (Dxxx)
Definition: DtCDBDatasetInfo.h:96

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)