MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LogicalTimeFactory.h
Go to the documentation of this file.
1 /***********************************************************************
2  The IEEE hereby grants a general, royalty-free license to copy, distribute,
3  display and make derivative works from this material, for all purposes,
4  provided that any use of the material contains the following
5  attribution: "Reprinted with permission from IEEE 1516.1(TM)-2010".
6  Should you require additional information, contact the Manager, Standards
7  Intellectual Property, IEEE Standards Association (stds-ipr@ieee.org).
8 ***********************************************************************/
9 /***********************************************************************
10  IEEE 1516.1 High Level Architecture Interface Specification C++ API
11  File: RTI/LogicalTimeFactory.h
12 ***********************************************************************/
13 
14 #ifndef RTI_LogicalTimeFactory_h
15 #define RTI_LogicalTimeFactory_h
16 
17 namespace rti1516e
18 {
19  class LogicalTime;
20  class LogicalTimeInterval;
21  class VariableLengthData;
22 }
23 
24 namespace std
25 {
26  template <class T> class auto_ptr;
27 }
28 
29 #include <RTI/SpecificConfig.h>
30 #include <RTI/Exception.h>
31 #include <string>
32 
33 // LogicalTimeFactory is used by the RTI to construct instances of classes
34 // derived from LogicalTime and LogicalTimeInterval. A federation is responsible
35 // for providing a fedtime library that includes one or more subclasses
36 // of LogicalTime and LogicalTimeInterval, one or more subclasses of LogicalTimeFactory
37 // (which is used to create instances of those LogicalTime and LogicalTimeInterval
38 // subclasses), and a single implementation of
39 // LogicalTimeFactoryFactory::makeLogicalTimeFactory. This static function should
40 // choose a LogicalTimeFactory based on the string identifier passed as an argument,
41 // and return an instance of that kind of factory. The RTI will call this function to
42 // obtain a LogicalTimeFactory for a federation, and then will use that factory to create
43 // any instances of LogicalTime or LogicalTimeInterval that it needs.
44 
45 // All RTIs shall implement a reference time library with time types named HLAinteger64Time
46 // and HLAfloat64Time. The interfaces for these types shall be found in the time subdirectory.
47 
48 namespace rti1516e
49 {
51  {
52  public:
53  virtual ~LogicalTimeFactory ()
54  throw () = 0;
55 
56  // Return a LogicalTime with a value of "initial"
57  virtual std::auto_ptr< LogicalTime > makeInitial()
58  throw (
59  InternalError) = 0;
60 
61  // Return a LogicalTime with a value of "final"
62  virtual std::auto_ptr< LogicalTime > makeFinal()
63  throw (
64  InternalError) = 0;
65 
66  // Return a LogicalTimeInterval with a value of "zero"
67  virtual std::auto_ptr< LogicalTimeInterval > makeZero()
68  throw (
69  InternalError) = 0;
70 
71  // Return a LogicalTimeInterval with a value of "epsilon"
72  virtual std::auto_ptr< LogicalTimeInterval > makeEpsilon()
73  throw (
74  InternalError) = 0;
75 
76  // LogicalTime decode from an encoded LogicalTime
77  virtual std::auto_ptr< LogicalTime > decodeLogicalTime (
78  VariableLengthData const & encodedLogicalTime)
79  throw (
80  InternalError,
81  CouldNotDecode) = 0;
82 
83  // Alternate LogicalTime decode that reads directly from a buffer
84  virtual std::auto_ptr< LogicalTime > decodeLogicalTime (
85  void* buffer,
86  size_t bufferSize)
87  throw (
88  InternalError,
89  CouldNotDecode) = 0;
90 
91  // LogicalTimeInterval decode from an encoded LogicalTimeInterval
92  virtual std::auto_ptr< LogicalTimeInterval > decodeLogicalTimeInterval (
93  VariableLengthData const & encodedValue)
94  throw (
95  InternalError,
96  CouldNotDecode) = 0;
97 
98  // Alternate LogicalTimeInterval decode that reads directly from a buffer
99  virtual std::auto_ptr< LogicalTimeInterval > decodeLogicalTimeInterval (
100  void* buffer,
101  size_t bufferSize)
102  throw (
103  InternalError,
104  CouldNotDecode) = 0;
105 
106  // Return the name of the logical time implementation
107  virtual std::wstring getName () const = 0;
108  };
109 
111  {
112  public:
113 
114  // Provides a factory for the standard logical time types HLAfloat64Time
115  // and HLAinteger64Time. The RTI reference time library's
116  // LogicalTimeFactoryFactory should just forward requests to here.
117  static std::auto_ptr< LogicalTimeFactory > makeLogicalTimeFactory (
118  std::wstring const & implementationName);
119  };
120 }
121 
122 namespace rti1516e
123 {
125  {
126  public:
127 
128  // The name is used to choose among several LogicalTimeFactories that might
129  // be present in the fedtime library. Each federation chooses its
130  // implementation by passing the appropriate name to createFederationExecution.
131  // If the supplied name is the empty string, a default LogicalTimeFactory is
132  // returned. If the supplied implementation name does not match any name
133  // supported by the library, then a NULL pointer is returned.
134  static std::auto_ptr< LogicalTimeFactory > makeLogicalTimeFactory (
135  std::wstring const & implementationName);
136  };
137 }
138 
139 #endif // RTI_LogicalTimeFactory_h

Document ID: Generated on Mon Mar 21 09:41:37 EDT 2016 from SVN revision 163228
Copyright © 2005-2015 VT MÄK Inc. All Rights Reserved (www.mak.com)