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
21
namespace
ttsdk
{
22
23
struct
UserParameter
24
{
25
public
:
26
UserParameter
();
27
UserParameter
(
const
UserParameter
&
other
);
28
~UserParameter
();
29
UserParameter
&
operator=
(
const
UserParameter
&
other
);
30
31
char
name
[75] = { 0 };
32
UserDataType
type
=
UserDataType::UserDataTypeEmpty
;
33
double
v_double
=
NAN
;
34
double
v_price
=
NAN
;
35
int32_t
v_int
= -2147483648LL;
36
uint32_t
v_uint
= 0;
37
uint64_t
v_timestamp
= 0;
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
45
inline
UserParameter::UserParameter
()
46
{
47
}
48
49
inline
UserParameter::UserParameter
(
const
ttsdk::UserParameter
&
other
)
50
{
51
*
this
=
other
;
52
}
53
54
inline
UserParameter
&
ttsdk::UserParameter::operator=
(
const
ttsdk::UserParameter
&
other
)
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
73
inline
UserParameter::~UserParameter
() {
74
if
(
v_string
)
75
delete
[]
v_string
;
76
}
77
78
79
}
UserDataType.h
ttsdk::shared_ptr
Definition
shared_ptr.h:26
ttsdk
Definition
account.h:21
ttsdk::UserDataType
UserDataType
Definition
UserDataType.h:22
ttsdk::UserDataTypeEmpty
@ UserDataTypeEmpty
Definition
UserDataType.h:30
ttsdk::UserParameter
Definition
user_parameter.h:24
ttsdk::UserParameter::UserParameter
UserParameter()
Definition
user_parameter.h:45
ttsdk::UserParameter::name
char name[75]
Definition
user_parameter.h:31
ttsdk::UserParameter::~UserParameter
~UserParameter()
Definition
user_parameter.h:73
ttsdk::UserParameter::v_double
double v_double
Definition
user_parameter.h:33
ttsdk::UserParameter::v_price
double v_price
Definition
user_parameter.h:34
ttsdk::UserParameter::type
UserDataType type
Definition
user_parameter.h:32
ttsdk::UserParameter::v_bool
bool v_bool
Definition
user_parameter.h:38
ttsdk::UserParameter::v_timestamp
uint64_t v_timestamp
Definition
user_parameter.h:37
ttsdk::UserParameter::v_int
int32_t v_int
Definition
user_parameter.h:35
ttsdk::UserParameter::v_uint
uint32_t v_uint
Definition
user_parameter.h:36
ttsdk::UserParameter::v_string
char * v_string
Definition
user_parameter.h:41
ttsdk::UserParameter::operator=
UserParameter & operator=(const UserParameter &other)
Definition
user_parameter.h:54
Header Files
user_parameter.h
Generated by
1.10.0