torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Versions.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for the Versions class.
18 
19 #ifndef TORC_ARCHITECTURE_VERSIONS_HPP
20 #define TORC_ARCHITECTURE_VERSIONS_HPP
21 
26 
27 namespace torc {
28 namespace architecture {
29 
30 // forward declaration of our unit test class within its namespace
31 namespace architecture { class DigestStreamUnitTest; }
32 
33  /// \brief Encapsulation of database version information.
34  /// \details The format version information determines if and how DDB should read the database.
35  /// The vendor vesion information indicates the version of the vendor tools that the
36  /// database was generated from.
38  // friends
39  /// \brief The database has access to our protected functions.
40  friend class DDB;
41  /// \brief The DigestStream unit test has access to our protected functions.
43  protected:
44  // types
45  typedef std::string string; ///< \brief Imported type name.
46  typedef boost::uint8_t uint8_t; ///< \brief Imported type name.
47  typedef boost::uint16_t uint16_t; ///< \brief Imported type name.
48  typedef boost::uint32_t uint32_t; ///< \brief Imported type name.
49  typedef torc::common::DottedVersion DottedVersion; ///< \brief Imported type name.
50  // nested classes
51  protected:
52  // members
53  /// \brief The database format version.
55  /// \brief The database build number.
57  /// \brief The vendor data version.
59  /// \brief The vendor data version string.
60  string mVendorString;
61  // functions
62  /// \brief Read the version information.
63  size_t readVersions(DigestStream& inStream, bool inShowVersion = false);
64  // constructors
65  /// \brief Protected constructor.
66  Versions(void) : mFormat(), mBuild(0), mVendor(), mVendorString() {}
67  public:
68  // accessors
69  /// \brief Returns the database format version.
70  const DottedVersion& getFormat(void) const { return mFormat; }
71  /// \brief Returns the database build number.
72  uint32_t getBuild(void) const { return mBuild; }
73  /// \brief Returns the vendor data version.
74  const DottedVersion& getVendor(void) const { return mVendor; }
75  /// \brief Returns the database format version string.
76  const string& getVendorString(void) const { return mVendorString; }
77  };
78 
79 } // namespace architecture
80 } // namespace torc
81 
82 #endif // TORC_ARCHITECTURE_VERSIONS_HPP
size_t readVersions(DigestStream &inStream, bool inShowVersion=false)
Read the version information.
Definition: Versions.cpp:25
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
Device database console streams class.
std::string string
Imported type name.
Definition: Versions.hpp:45
Header for the DottedVersion class.
std::string string
Header for the DDBConsoleStreams class.
DottedVersion mFormat
The database format version.
Definition: Versions.hpp:54
boost::uint16_t uint16_t
Imported type name.
Definition: Versions.hpp:47
Encapsulation of dotted decimal DottedVersion numbers.
DottedVersion mVendor
The vendor data version.
Definition: Versions.hpp:58
Encapsulation of database version information.
Definition: Versions.hpp:37
string mVendorString
The vendor data version string.
Definition: Versions.hpp:60
boost::uint32_t uint32_t
Imported type name.
Definition: Versions.hpp:48
Header for the DigestStream class.
Versions(void)
Protected constructor.
Definition: Versions.hpp:66
boost::uint8_t uint8_t
Imported type name.
Definition: Versions.hpp:46
const string & getVendorString(void) const
Returns the database format version string.
Definition: Versions.hpp:76
uint32_t mBuild
The database build number.
Definition: Versions.hpp:56
Encapsulation of a device or family digest stream.
uint32_t getBuild(void) const
Returns the database build number.
Definition: Versions.hpp:72
friend class torc::architecture::architecture::DigestStreamUnitTest
The DigestStream unit test has access to our protected functions.
Definition: Versions.hpp:42
const DottedVersion & getFormat(void) const
Returns the database format version.
Definition: Versions.hpp:70
const DottedVersion & getVendor(void) const
Returns the vendor data version.
Definition: Versions.hpp:74
torc::common::DottedVersion DottedVersion
Imported type name.
Definition: Versions.hpp:49
Device database types for Xilinx architectures.