OnixS Eurex ETI Handler C++ library  9.19.0
API documentation
AuditTrail.h
Go to the documentation of this file.
1 /*
2  * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3  *
4  * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5  * and international copyright treaties.
6  *
7  * Access to and use of the software is governed by the terms of the applicable ONIXS Software
8  * Services Agreement (the Agreement) and Customer end user license agreements granting
9  * a non-assignable, non-transferable and non-exclusive license to use the software
10  * for it's own data processing purposes under the terms defined in the Agreement.
11  *
12  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13  * of this source code or associated reference material to any other location for further reproduction
14  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15  *
16  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17  * the terms of the Agreement is a violation of copyright law.
18  */
19 
20 #pragma once
21 
22 #include "OnixS/Eurex/Trading/Export.h"
26 #include "OnixS/Eurex/Trading/UniquePtr.h"
27 
28 #include <string>
29 
30 namespace OnixS {
31 namespace Eurex {
32 namespace Trading {
33 namespace AuditTrail {
34 
35 /// Indicates message flow direction.
36 struct ONIXS_EUREX_ETI_EXPORT Direction
37 {
38  /// \copydoc Direction
39  enum Enum
40  {
41  NoValue, ///< No value.
42  In, ///< Received.
43  Out, ///< Sent.
44  };
45 
46  /// Returns string representation.
47  static std::string toString (Enum);
48 };
49 
50 /// Collects Audit Trail file record fields.
51 struct ONIXS_EUREX_ETI_EXPORT Entry
52 {
53  /// Creates empty record entry.
54  Entry() : direction(Direction::NoValue) {}
55 
56  /// Direction.
58 
59  /// Timestamp.
61 
62  /// Message.
63  PtrTraits<Message>::UniquePtr message;
64 
65  /// Message info.
67 };
68 
69 /// A Reader reads Audit Trail files, created by Handler,
70 /// and decodes them into entries. Each entry contains direction
71 /// (In or Oout), timestamp, message info and pointer to Message object.
72 class ONIXS_EUREX_ETI_EXPORT Reader
73 {
74 public:
75  /// Creates an Reader that reads files from given directory.
76  ///
77  /// \param filePath full path to Audit Trail file.
78  Reader(const std::string& filePath);
79 
80  /// Creates an Reader that reads files from given directory.
81  ///
82  /// \param directory the directory where audit trail files stored.
83  /// \param fileNamePrefix template of Audit Trail file name without extension.
84  ///
85  /// \remarks Standard wildcard '*' can be used in fileNamePrefix argument.
86  Reader(const std::string& directory, const std::string& fileNamePrefix);
87 
88  /// Releases any system resources associated with instance.
89  ~Reader();
90 
91  /// Reads a single Audit Trail entry.
92  ///
93  /// \param entry Audit Trail record entry fields.
94  bool read (Entry& entry);
95 
96 private:
97  Reader(const Reader&); //no implementation
98  Reader& operator=(const Reader&); //no implementation
99 
100 private:
101  struct Impl;
102  Impl* impl_;
103 };
104 
105 }
106 }
107 }
108 }
HighResolutionTimeFields timestamp
Timestamp.
Definition: AuditTrail.h:60
Fields of HighResolutionTime.
Definition: Time.h:60
Collects Audit Trail file record fields.
Definition: AuditTrail.h:51
Entry()
Creates empty record entry.
Definition: AuditTrail.h:54
Enum
Indicates message flow direction.
Definition: AuditTrail.h:39
PtrTraits< Message >::UniquePtr message
Message.
Definition: AuditTrail.h:63
Indicates message flow direction.
Definition: AuditTrail.h:36
MessageInfo messageInfo
Message info.
Definition: AuditTrail.h:66
Direction::Enum direction
Direction.
Definition: AuditTrail.h:57