OnixS C++ ICE Binary Order Entry Handler 1.1.1
API Documentation
Loading...
Searching...
No Matches
ServiceFactory.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#pragma once
20
21#include <OnixS/ICE/BOE/ABI.h>
23
25
26class SessionSettings;
27
30{
31public:
38 ThreadParams() = default;
39
45 ThreadParams(std::string name, CpuIndexes affinity, int priority = 0, int policy = 0)
46 : name_(std::move(name))
47 , affinity_(std::move(affinity))
48 , priority_(priority)
49 , policy_(policy)
50 {}
51
53 const std::string& name() const { return name_; }
54
56 const CpuIndexes& affinity() const { return affinity_; }
57
59 int priority() const { return priority_; }
60
62 int policy() const { return policy_; }
63
67 {
68 name_ = std::move(name);
69 return *this;
70 }
71
75 {
76 affinity_ = std::move(affinity);
77 return *this;
78 }
79
83 {
84 priority_ = priority;
85 return *this;
86 }
87
91 {
92 policy_ = policy;
93 return *this;
94 }
95
96private:
97 std::string name_;
98 CpuIndexes affinity_;
99 int priority_{0};
100 int policy_{0};
101};
102
107{
108public:
111 ServiceFactory(uint16_t threadCount, const ThreadParams& params);
112
115
118 ServiceFactory& operator = (const ServiceFactory&) = delete;
119
120private:
121 class Impl;
122 Impl* const impl_;
123 friend class Session;
124};
125
#define ONIXS_ICEBOE_NAMESPACE_BEGIN
Definition ABI.h:94
#define ONIXS_ICEBOE_NAMESPACE_END
Definition ABI.h:98
#define ONIXS_ICEBOE_EXPORTED
Definition Compiler.h:155
ServiceFactory(const ServiceFactory &)=delete
ServiceFactory(const SessionSettings &setting)
ServiceFactory(uint16_t threadCount, const ThreadParams &params)
std::set< CpuIndex > CpuIndexes
Definition Defines.h:71
Parameters used to configure a thread.
const CpuIndexes & affinity() const
const std::string & name() const
ThreadParams()=default
Construct default thread parameters.
ThreadParams & setName(std::string name)
Sets the thread name.
ThreadParams & setPolicy(int policy)
Sets the scheduling policy.
ThreadParams & setAffinity(CpuIndexes affinity)
Sets the CPU affinity.
ThreadParams & setPriority(int priority)
Sets the scheduling priority.
ThreadParams(std::string name, CpuIndexes affinity, int priority=0, int policy=0)
Construct thread parameters with explicit values.