NCBI C++ ToolKit
event_log_service_impl.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_FRAMEWORK___EVENT_LOG_SERVICE_IMPL__HPP
2 #define GUI_FRAMEWORK___EVENT_LOG_SERVICE_IMPL__HPP
3 
4 /* $Id: event_log_service_impl.hpp 35258 2016-04-18 01:35:40Z whlavina $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
35 /** @addtogroup GUI_FRAMEWORK
36 *
37 * @{
38 */
39 
40 #include <corelib/ncbiobj.hpp>
41 
42 #include <gui/gui_export.h>
45 
47 
48 #include <deque>
49 
51 
52 class CLogServiceEvent : public CEvent
53 {
54 public:
55  enum EEventId {
57  };
58 
60 };
61 
62 
63 ///////////////////////////////////////////////////////////////////////////////
64 /// CEventLogService - the standard implementation of IEventLogService.
65 /// see IEventLogService interface for information.
67  public CObjectEx,
68  public IEventLogService,
69  public IService,
70  public CEventHandler
71 {
72 public:
74 
75  /// @name IService interface implementation
76  /// @{
77  virtual void InitService();
78  virtual void ShutDownService();
79  /// @}
80 
81  /// @name IEventLogService interface implementation
82  /// @{
83  virtual void AddRecord(IEventRecord* record);
84 
85  virtual size_t GetRecordsCount() const;
86  virtual const IEventRecord* GetRecord(size_t index) const;
87  /// @}
88 
89 protected:
91  typedef deque<TIRef> TRecords;
92 
94 };
95 
96 
97 ///////////////////////////////////////////////////////////////////////////////
98 /// CEventRecord - standard implementation of IEventRecord.
99 /// CEventRecord must be subclassed to implement GetAction().
101  public CObject,
102  public IEventRecord
103 {
104 public:
106  const string& title = kEmptyStr,
107  const string& descr = kEmptyStr,
108  const TTime& time = 0);
109 
110  /// @name IEventRecord implementation
111  /// @{
112  virtual EType GetType() const;
113  virtual string GetTitle() const;
114  virtual string GetDescription() const;
115  virtual const TTime& GetTime() const;
116  /// @}
117 
118  virtual void SetType(EType type);
119  virtual void SetTitle(const string& title);
120  virtual void SetDescription(const string& descr);
121  virtual void SetTime(const TTime& time);
122 
123 protected:
125  string m_Title;
128 };
129 
130 
132 
133 /* @} */
134 
135 #endif // GUI_FRAMEWORK___EVENT_LOG_SERVICE_IMPL__HPP
136 
CEventHandler.
CEventLogService - the standard implementation of IEventLogService.
CEventRecord - standard implementation of IEventRecord.
CEvent - generic event implementation TODO TODO - Attachments.
Definition: event.hpp:86
CObjectEx –.
Definition: ncbiobj.hpp:2531
CObject –.
Definition: ncbiobj.hpp:180
IEventLogService - records application events.
IEventRecord.
IService an abstraction that represents an application component providing specific functional capa...
Definition: service.hpp:56
virtual void AddRecord(IEventRecord *record)=0
Records are managed by CIRef inside the service.
virtual size_t GetRecordsCount() const =0
returns the total number of records
virtual const IEventRecord * GetRecord(size_t index) const =0
returns the record with the specified index
CIRef< IEventRecord > TIRef
virtual void InitService()=0
virtual void ShutDownService()=0
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
Definition: seqtitle.cpp:106
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIFRAMEWORK_EXPORT
Definition: gui_export.h:509
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Definition: type.c:6
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Sun Feb 25 03:05:24 2024 by modify_doxy.py rev. 669887