Nebula
Loading...
Searching...
No Matches
debugserver.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13#include "core/refcounted.h"
14#include "core/singleton.h"
16#include "util/stringatom.h"
17
18//------------------------------------------------------------------------------
19namespace Debug
20{
21class DebugCounter;
22class DebugTimer;
23
67
68//------------------------------------------------------------------------------
71inline bool
73{
74 bool retval;
75 this->critSect.Enter();
76 retval = this->isOpen;
77 this->critSect.Leave();
78 return retval;
79}
80
81} // namespace Debug
82//------------------------------------------------------------------------------
The common base class of Nebula.
Definition refcounted.h:38
The message handler for the debug interface.
Definition debughandler.h:21
Http request handler for the Debug subsystem.
Definition debugpagehandler.h:21
The debug server singleton is visible from all threads and keeps track of debug timer and debug count...
Definition debugserver.h:25
__DeclareInterfaceSingleton(DebugServer)
void UnregisterDebugCounter(const Ptr< DebugCounter > &counter)
unregister a debug counter
Definition debugserver.cc:105
bool isOpen
Definition debugserver.h:62
Ptr< DebugTimer > GetDebugTimerByName(const Util::StringAtom &name) const
get debug timer by name, returns invalid ptr if not exists
Definition debugserver.cc:142
DebugServer()
constructor
Definition debugserver.cc:21
Util::Dictionary< Util::StringAtom, Ptr< DebugTimer > > debugTimers
Definition debugserver.h:64
Util::Array< Ptr< DebugCounter > > GetDebugCounters() const
get all registered debug counters
Definition debugserver.cc:130
virtual ~DebugServer()
destructor
Definition debugserver.cc:30
Util::Dictionary< Util::StringAtom, Ptr< DebugCounter > > debugCounters
Definition debugserver.h:65
void RegisterDebugTimer(const Ptr< DebugTimer > &timer)
register a debug timer
Definition debugserver.cc:66
void RegisterDebugCounter(const Ptr< DebugCounter > &counter)
register a debug counter
Definition debugserver.cc:92
Util::Array< Ptr< DebugTimer > > GetDebugTimers() const
get all registered debug timers
Definition debugserver.cc:118
void UnregisterDebugTimer(const Ptr< DebugTimer > &timer)
unregister a debug timer
Definition debugserver.cc:79
bool IsOpen() const
return true if debug server is open
Definition debugserver.h:72
void Open()
open the debug server
Definition debugserver.cc:40
Threading::CriticalSection critSect
Definition debugserver.h:63
Ptr< DebugCounter > GetDebugCounterByName(const Util::StringAtom &name) const
get debug counter by name, returns invalid ptr if not exists
Definition debugserver.cc:158
void Close()
close the debug server
Definition debugserver.cc:52
__DeclareClass(DebugServer)
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Critical section objects are used to protect a portion of code from parallel execution.
Nebula's dynamic array class.
Definition array.h:60
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
A StringAtom.
Definition stringatom.h:22
Definition corepagehandler.cc:13