EpcTools
An event based multi-threaded C++ development framework.
einternal.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2009-2019 Brian Waters
3 * Copyright (c) 2019 Sprint
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17 
18 #ifndef __einternal_h_included
19 #define __einternal_h_included
20 
21 #include "ebase.h"
22 #include "egetopt.h"
23 #include "estatic.h"
24 #include "elogger.h"
25 
28 
30 class EpcTools
31 {
32 public:
35  static Void Initialize(EGetOpt &options);
37  static Void UnInitialize();
38 
41  static Int getInternalLogId() { return m_internalLogId; }
44  static Void setInternalLogId(Int logid) { m_internalLogId = logid; }
45 
48  static Int getApplicationId() { return m_appid; }
51  static Void setApplicationId(Int appid) { m_appid = appid; }
52 
55  static Bool isPublicEnabled() { return m_public; }
58  static Bool isDebug() { return m_debug; }
59 
60 private:
61  static Int m_internalLogId;
62  static Int m_appid;
63  static Bool m_public;
64  static Bool m_debug;
65 };
66 
67 // #define ELOG_MUTEX ((ULongLong)0x0000000000000001)
68 // #define ELOG_SEMAPHORE ((ULongLong)0x0000000000000002)
69 // #define ELOG_SEMNOTICE ((ULongLong)0x0000000000000004)
70 // #define ELOG_SHAREDMEMORY ((ULongLong)0x0000000000000008)
71 // #define ELOG_SYNCHOBJECTS ((ULongLong)0x0000000000000010)
72 
73 // #define ELOGFUNC(f) static cpStr __funcname__ = #f
74 // #define ELOG(groupid, severity, format...) ELogger::log(FoundationTools::getInternalLogId(), groupid, severity, __funcname__, format)
75 // #define ELOGINFO(groupid, format...) ELogger::logInfo(FoundationTools::getInternalLogId(), groupid, __funcname__, format)
76 // #define ELOGWARN(groupid, format...) ELogger::logWarning(FoundationTools::getInternalLogId(), groupid, __funcname__, format)
77 // #define ELOGERROR(groupid, format...) ELogger::logError(FoundationTools::getInternalLogId(), groupid, __funcname__, format)
78 
80 #define SECTION_TOOLS "EpcTools"
81 #define SECTION_SYNCH_OBJS "SynchronizationObjects"
82 #define SECTION_PUBLIC_QUEUE "PublicQueue"
83 
84 #define SECTION_LOGGER "Logger"
85 #define MEMBER_LOGGER_APPLICATION_NAME "ApplicationName"
86 #define MEMBER_LOGGER_QUEUE_SIZE "QueueSize"
87 #define MEMBER_LOGGER_NUMBER_THREADS "NumberThreads"
88 #define MEMBER_LOGGER_SINK_SETS "SinkSets"
89 #define MEMBER_LOGGER_SINK_ID "SinkID"
90 #define MEMBER_LOGGER_SINKS "Sinks"
91 #define MEMBER_LOGGER_SINK_TYPE "SinkType"
92 #define MEMBER_LOGGER_LOG_LEVEL "LogLevel"
93 #define MEMBER_LOGGER_PATTERN "Pattern"
94 #define MEMBER_LOGGER_FILE_NAME "FileName"
95 #define MEMBER_LOGGER_FILE_TRUNCATE "Truncate"
96 #define MEMBER_LOGGER_FILE_ROTATE_ON_OPEN "RotateOnOpen"
97 #define MEMBER_LOGGER_MAX_SIZE "MaxSizeMB"
98 #define MEMBER_LOGGER_MAX_FILES "MaxNumberFiles"
99 #define MEMBER_LOGGER_ROLLOVER_HOUR "RolloverHour"
100 #define MEMBER_LOGGER_ROLLOVER_MINUTE "RolloverMinute"
101 #define MEMBER_LOGGER_LOGS "Logs"
102 #define MEMBER_LOGGER_LOG_ID "LogID"
103 #define MEMBER_LOGGER_CATEGORY "Category"
104 
105 #define MEMBER_ENABLE_PUBLIC_OBJECTS "EnablePublicObjects"
106 #define MEMBER_NUMBER_SEMAPHORES "NumberSemaphores"
107 #define MEMBER_NUMBER_MUTEXES "NumberMutexes"
108 #define MEMBER_QUEUE_ID "QueueID"
109 #define MEMBER_QUEUE_SIZE "QueueSize"
110 #define MEMBER_MESSAGE_SIZE "MessageSize"
111 #define MEMBER_ALLOW_MULTIPLE_READERS "AllowMultipleReaders"
112 #define MEMBER_ALLOW_MULTIPLE_WRITERS "AllowMultipleWriters"
113 #define MEMBER_DEBUG "Debug"
114 // #define MEMBER_WRITE_TO_FILE "WriteToFile"
115 // #define MEMBER_QUEUE_MODE "QueueMode"
116 // #define MEMBER_LOGGER_ID "LogID"
117 // #define MEMBER_SEGMENTS "Segments"
118 // #define MEMBER_LINESPERSEGMENT "LinesPerSegment"
119 // #define MEMBER_FILENAMEMASK "FileNameMask"
120 // #define MEMBER_LOGTYPE "LogType"
121 // #define MEMBER_DEFAULTLOGMASK "DefaultLogMask"
122 // #define MEMBER_INTERNALLOG "InternalLog"
123 
125 
126 #endif // #define __einternal_h_included
estatic.h
Performs static initialization associated with any EpcTools class that requires it....
EpcTools::Initialize
static Void Initialize(EGetOpt &options)
Initialize the EpcTools runtime environment.
Definition: ebase.cpp:22
EpcTools::UnInitialize
static Void UnInitialize()
Uninitialize the EpcTools runtime environment.
Definition: ebase.cpp:33
EpcTools::setInternalLogId
static Void setInternalLogId(Int logid)
Sets the log ID associated with internal log messages.
Definition: einternal.h:44
ebase.h
Macros for various standard C library functions and standard includes.
elogger.h
Defines the logging related classes.
EpcTools
The primary class used to initialize/uninitialize EpcTools.
Definition: einternal.h:30
EGetOpt
Definition: egetopt.h:31
EpcTools::isPublicEnabled
static Bool isPublicEnabled()
Indicates that public features are enabled.
Definition: einternal.h:55
EpcTools::isDebug
static Bool isDebug()
Indicates that public features are enabled.
Definition: einternal.h:58
EpcTools::getInternalLogId
static Int getInternalLogId()
Gets the log ID associated with internal log messages.
Definition: einternal.h:41
egetopt.h
Manages configuration parameters from a file and the command line.
EpcTools::getApplicationId
static Int getApplicationId()
Gets the application ID for this application.
Definition: einternal.h:48
EpcTools::setApplicationId
static Void setApplicationId(Int appid)
Sets the application ID.
Definition: einternal.h:51