TT CORE SDK 2.0.1.1
TT CORE SDK documentation
Loading...
Searching...
No Matches
user_parameter.h
Go to the documentation of this file.
1/***************************************************************************
2 *
3 * Unpublished Work Copyright (c) 2020
4 * Trading Technologies International, Inc.
5 * All Rights Reserved Worldwide
6 *
7 * * * * S T R I C T L Y P R O P R I E T A R Y * * *
8 *
9 * WARNING: This program (or document) is unpublished, proprietary property
10 * of Trading Technologies International, Inc. and is to be maintained in
11 * strict confidence. Unauthorized reproduction, distribution or disclosure
12 * of this program (or document), or any program (or document) derived from
13 * it is prohibited by State and Federal law, and by local law outside of
14 * the U.S.
15 *
16 ***************************************************************************/
17#pragma once
18#include <string.h>
19#include "enums/UserDataType.h"
20
21namespace ttsdk {
22
24 {
25 public:
30
31 char name[75] = { 0 };
33 double v_double = NAN;
34 double v_price = NAN;
35 int32_t v_int = -2147483648LL;
38 bool v_bool = false;
39 // must be allocated on the heap. Object will take
40 // ownership of memory assigned to v_string variable
41 char* v_string = nullptr;
42 };
43
44
46 {
47 }
48
50 {
51 *this = other;
52 }
53
55 {
56 strncpy(name, other.name, sizeof(name));
57 type = other.type;
58 v_double = other.v_double;
59 v_int = other.v_int;
60 v_uint = other.v_uint;
61 v_timestamp = other.v_timestamp;
62 v_bool = other.v_bool;
63 v_string = nullptr;
64 if (other.v_string)
65 {
66 size_t len = strlen(other.v_string);
67 v_string = new char[len + 1];
68 strcpy(v_string, other.v_string);
69 }
70 return *this;
71 }
72
74 if (v_string)
75 delete[] v_string;
76 }
77
78
79}
@ UserDataTypeEmpty
UserParameter & operator=(const UserParameter &other)