OnixS C++ Tullett Prebon SURF Handler 1.6.1
API documentation
Loading...
Searching...
No Matches
FieldValue.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
13 * part of this source code or associated reference material to any other location for further
14 * reproduction or redistribution, and any amendments to this copyright notice, are expressly
15 * prohibited.
16 *
17 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
18 * the terms of the Agreement is a violation of copyright law.
19 */
20
21#pragma once
22
24#include <OnixS/SURF/MarketData/Export.h>
25
26#include <iosfwd>
27#include <string>
28
29namespace OnixS { namespace SURF { namespace MarketData {
30
32struct ONIXS_TP_SURF_EXPORT Date
33{
36
44 Date(int year, int month, int day);
45
47 int year;
48
50 int month;
51
53 int day;
54
56 std::string toString() const;
57};
58
59ONIXS_TP_SURF_EXPORT std::ostream& operator<<(std::ostream&, const Date&);
60
62struct ONIXS_TP_SURF_EXPORT Time
63{
66
72 Time(int hour, int minute);
73
75 int hour;
76
78 int minute;
79
81 std::string toString() const;
82};
83
84ONIXS_TP_SURF_EXPORT std::ostream& operator<<(std::ostream&, const Time&);
85
87struct ONIXS_TP_SURF_EXPORT FieldValue
88{
90 bool empty() const;
91
93 std::string toString() const;
94
98 int toInt32() const;
99
103 unsigned int toUInt32() const;
104
108 long long toInt64() const;
109
113 unsigned long long toUInt64() const;
114
118 double toDouble() const;
119
124
128 Date toDate() const;
129
133 Time toTime() const;
134
135protected:
136 FieldValue(const char* data, size_t length);
137 FieldValue(const FieldValue& value);
139
140private:
141 const char* data_;
142 size_t length_;
143};
144
145ONIXS_TP_SURF_EXPORT std::ostream& operator<<(std::ostream&, const FieldValue&);
146
147}}} // namespace OnixS::SURF::MarketData
std::ostream & operator<<(std::ostream &, const Decimal &)
std::string toString() const
Returns string representation.
int day
The day of the month represented by this instance.
Definition FieldValue.h:53
Date(int year, int month, int day)
int year
The year component of the date represented by this instance.
Definition FieldValue.h:47
int month
The month component of the date represented by this instance.
Definition FieldValue.h:50
Date()
Initialize default instance.
std::string toString() const
Returns the field value as a string.
FieldValue(const FieldValue &value)
bool empty() const
Indicates whether array of zero length.
FieldValue & operator=(const FieldValue &value)
FieldValue(const char *data, size_t length)
unsigned long long toUInt64() const
int hour
The hour component of the date represented by this instance.
Definition FieldValue.h:75
std::string toString() const
Returns string representation.
Time()
Initialize default instance.
int minute
The minute component of the date represented by this instance.
Definition FieldValue.h:78
Time(int hour, int minute)