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

Go to the SVN repository for this file.

1 #ifndef GUI_FRAMEWORK___EVENT_LOG_SERVICE__HPP
2 #define GUI_FRAMEWORK___EVENT_LOG_SERVICE__HPP
3 
4 /* $Id: event_log_service.hpp 31805 2014-11-17 16:56:57Z katargir $
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>
43 
44 
46 
47 class IEventRecord;
48 
49 ///////////////////////////////////////////////////////////////////////////////
50 /// IEventLogService - records application events.
52 {
53 public:
54  /// Records are managed by CIRef inside the service
55  virtual void AddRecord(IEventRecord* record) = 0;
56 
57  /// returns the total number of records
58  virtual size_t GetRecordsCount() const = 0;
59 
60  /// returns the record with the specified index
61  virtual const IEventRecord* GetRecord(size_t index) const = 0;
62 
63  virtual ~IEventLogService() {}
64 };
65 
66 
67 
68 ///////////////////////////////////////////////////////////////////////////////
69 /// IEventRecord
70 ///
71 /// IEventRecord - an interface representing an abstract record in Event Log.
72 /// IEventRecord provides descriptive information for an Event and, optionally,
73 /// an action that activates objects associated with the event.
74 ///
75 /// Classes implementing IEventRecord are managed using CIRef and so should be
76 /// derived from CObject.
77 
79 {
80 public:
81  typedef time_t TTime;
82 
83  enum EType {
84  eInfo = 0,
87  eLast
88  };
89 
90  virtual ~IEventRecord() {};
91 
92  virtual EType GetType() const = 0;
93 
94  // returns a short (one line) textual description of the event
95  virtual string GetTitle() const = 0;
96 
97  // returns long (~ one paragraph) textual description of the event
98  virtual string GetDescription() const = 0;
99 
100  // get event time
101  virtual const TTime& GetTime() const = 0;
102 };
103 
105 
106 /* @} */
107 
108 #endif // GUI_FRAMEWORK___EVENT_LOG_SERVICE__HPP
109 
IEventLogService - records application events.
IEventRecord.
virtual string GetTitle() const =0
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
virtual ~IEventRecord()
virtual const TTime & GetTime() const =0
virtual string GetDescription() const =0
virtual EType GetType() const =0
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Defines to provide correct exporting from DLLs in Windows.
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Wed Jun 12 11:20:20 2024 by modify_doxy.py rev. 669887