OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
Utils.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 <boost/noncopyable.hpp>
23 
24 #include <OnixS/Core/Concurrency/Mutex.h>
25 #include <OnixS/Core/Concurrency/Guards.h>
26 #include <OnixS/Core/Concurrency/Condition.h>
27 #include <OnixS/Core/Time/DateTime.h>
28 #include <OnixS/Core/Time/Operators.h>
29 
30 #include <util/String.h>
31 
32 #include <OnixS/HandlerCore/HandlerLogger.h>
33 
35 
36 
37 namespace OnixS {
38 namespace SgxTitan {
39 namespace Trading {
40 namespace Ouch {
41 
42 typedef OnixS::Concurrency::RecursiveMutex Mutex;
44 typedef OnixS::Concurrency::Guard<OnixS::Concurrency::Mutex> Guard;
45 typedef Guard ReleaseGuard;
46 
48 {
49 public:
50  static Timestamp convert(const OnixS::Time::DateTime& time);
51  static OnixS::Time::DateTime convert(const Timestamp& time);
52 };
53 
54 namespace Implementation {
55 
56 /*
57  User exception handler
58 */
59 
60 void userExceptionHandler (OnixS::HandlerCore::Common::HandlerLogger&, Logging::LogFacility*, const char* contextName);
61 
62 #define ONIXS_EXCEPTION_TRACED_CALLBACK_EX(callback, logger, logFacility, contextName) \
63 try { callback; } catch(...) { OnixS::SgxTitan::Trading::Ouch::Implementation::userExceptionHandler(logger, logFacility, contextName); } \
64 
65 #define ONIXS_EXCEPTION_TRACED_CALLBACK(callback, contextName) ONIXS_EXCEPTION_TRACED_CALLBACK_EX(callback, logger_, this, contextName)
66 
68 }
69 
OnixS::Concurrency::Guard< OnixS::Concurrency::Mutex > Guard
Definition: Utils.h:44
void userExceptionHandler(OnixS::HandlerCore::Common::HandlerLogger &, Logging::LogFacility *, const char *contextName)
OnixS::Concurrency::RecursiveMutex Mutex
Definition: Utils.h:42
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_END
Definition: Bootstrap.h:31
Represents timestamp without time-zone information.
Definition: Timestamp.h:82
OnixS::Concurrency::Condition Condition
Definition: Utils.h:43
static Timestamp convert(const OnixS::Time::DateTime &time)
Definition: Utils.cpp:46