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

Go to the SVN repository for this file.

1 #ifndef OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__MESSAGES_HPP
2 #define OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__MESSAGES_HPP
3 
4 /* $Id: messages.hpp 100774 2023-09-11 15:09:57Z saprykin $
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: Dmitrii Saprykin
30  *
31  * File Description:
32  *
33  * PSG storage message texts
34  *
35  */
36 
37 #include <corelib/ncbistd.hpp>
38 
39 #include <string>
40 #include <map>
41 
43 
46 
48 {
50  public:
51  CPSGMessages() = default;
52  CPSGMessages(CPSGMessages const&) = default;
53  CPSGMessages(CPSGMessages &&) = default;
54  CPSGMessages& operator=(CPSGMessages const&) = default;
56 
57  CPSGMessages& Set(string name, string value)
58  {
59  m_Messages[name] = value;
60  return *this;
61  }
62 
63  string Get(string const& name) const
64  {
65  auto itr = m_Messages.find(name);
66  if (itr != m_Messages.cend()) {
67  return itr->second;
68  }
69  return "";
70  }
71 
72  bool operator==(CPSGMessages const& a) const
73  {
74  return m_Messages == a.m_Messages;
75  }
76 
77  bool IsEmpty() const
78  {
79  return m_Messages.empty();
80  }
81 
82  void Clear()
83  {
84  m_Messages.clear();
85  }
86 
87  private:
89 };
90 
92 
93 #endif // OBJTOOLS__PUBSEQ_GATEWAY__IMPL__CASSANDRA__MESSAGES_HPP
94 
#define END_IDBLOB_SCOPE
Definition: IdCassScope.hpp:40
#define BEGIN_IDBLOB_SCOPE
Definition: IdCassScope.hpp:39
CPSGMessages & operator=(CPSGMessages &&)=default
CPSGMessages(CPSGMessages const &)=default
bool operator==(CPSGMessages const &a) const
Definition: messages.hpp:72
TCollection m_Messages
Definition: messages.hpp:88
string Get(string const &name) const
Definition: messages.hpp:63
bool IsEmpty() const
Definition: messages.hpp:77
void Clear()
Definition: messages.hpp:82
CPSGMessages()=default
CPSGMessages & Set(string name, string value)
Definition: messages.hpp:57
CPSGMessages(CPSGMessages &&)=default
CPSGMessages & operator=(CPSGMessages const &)=default
bool empty() const
Definition: map.hpp:149
void clear()
Definition: map.hpp:169
const_iterator find(const key_type &key) const
Definition: map.hpp:153
char value[7]
Definition: config.c:431
Include a standard set of the NCBI C++ Toolkit most basic headers.
BEGIN_IDBLOB_SCOPE USING_NCBI_SCOPE
Definition: messages.hpp:45
unsigned int a
Definition: ncbi_localip.c:102
Modified on Sat Dec 09 04:49:55 2023 by modify_doxy.py rev. 669887