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

Go to the SVN repository for this file.

1 #ifndef HTML___COMMENTDIAG__HPP
2 #define HTML___COMMENTDIAG__HPP
3 
4 /* $Id: commentdiag.hpp 33815 2007-05-04 17:18:18Z kazimird $
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  * Author: Aaron Ucko
30  *
31  */
32 
33 /// @file commentdiag.hpp
34 /// Diagnostic handler for embedding diagnostics in comments.
35 
36 
37 #include <corelib/ncbistd.hpp>
38 #include <html/html.hpp>
39 
40 /** @addtogroup DiagHandler
41  *
42  * @{
43  */
44 
45 
47 
48 
50 {
51 public:
52  CCommentDiagHandler() : m_Node(NULL) {}
53  void SetDiagNode(CNCBINode* node) { m_Node = node; }
54  virtual void Post(const SDiagMessage& mess);
55 
56 private:
58 };
59 
60 
62 {
63 public:
64  virtual CDiagHandler* New(const string&)
65  { return new CCommentDiagHandler; }
66 };
67 
68 
69 inline NCBI_XHTML_EXPORT
71 {
72  if (handler == NULL) {
74  }
75 
76  CCommentDiagHandler* comment_handler
77  = dynamic_cast<CCommentDiagHandler*>(handler);
78  if (comment_handler != NULL) {
79  comment_handler->SetDiagNode(node);
80  }
81  return comment_handler;
82 }
83 
84 
86 
87 
88 /* @} */
89 
90 #endif /* HTML___COMMENTDIAG__HPP */
CDiagFactory –.
Definition: ncbidiag.hpp:2925
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NULL
Definition: ncbistd.hpp:225
virtual CDiagHandler * New(const string &)
Factory method interface.
Definition: commentdiag.hpp:64
CCommentDiagHandler * SetDiagNode(CNCBINode *node, CDiagHandler *handler=NULL)
Definition: commentdiag.hpp:70
void SetDiagNode(CNCBINode *node)
Definition: commentdiag.hpp:53
CNCBINode * m_Node
Definition: commentdiag.hpp:57
virtual void Post(const SDiagMessage &mess)=0
Post message to handler.
CDiagHandler * GetDiagHandler(bool take_ownership=false, bool *current_ownership=0)
Get the currently set diagnostic handler class.
Definition: ncbidiag.cpp:6329
#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 NCBI_XHTML_EXPORT
Definition: ncbi_export.h:1139
HTML classes.
SDiagMessage –.
Definition: ncbidiag.hpp:1599
Modified on Sun May 05 05:15:53 2024 by modify_doxy.py rev. 669887