Update pingcheck to work with cmake 3.28
[pingcheck] / test / mock_statusnotifiercommand.h
CommitLineData
c5db9dfd
GMF
1/*
2The software in this package is distributed under the GNU General
3Public License version 2 (with a special exception described below).
4
5A copy of GNU General Public License (GPL) is included in this distribution,
6in the file COPYING.GPL.
7
8As a special exception, if other files instantiate templates or use macros
9or inline functions from this file, or you compile this file and link it
10with other works to produce a work based on this file, this file
11does not by itself cause the resulting work to be covered
12by the GNU General Public License.
13
14However the source code for this file must still be made available
15in accordance with section (3) of the GNU General Public License.
16
17This exception does not invalidate any other reasons why a work based
18on this file might be covered by the GNU General Public License.
19*/
20#ifndef STATUS_NOTIFIER_COMMAND_H
21#define STATUS_NOTIFIER_COMMAND_H
22
23#include <string>
24
25#include <boost/scoped_ptr.hpp>
26
27#define UNDER_TEST
28
29//-----------------------------------------------------------------------------
30// StatusNotifierCommand
31//-----------------------------------------------------------------------------
32
33/**
34 * @brief This class provides methods to handle status-notifier-cmd
35 * configuration.
36 */
37class StatusNotifierCommand
38{
39public:
40 static const std::string StatusToken;
41
42public:
43 explicit StatusNotifierCommand( const std::string &status_notifier_cmd );
44 virtual ~StatusNotifierCommand();
45
46 bool set_token_value(
47 const std::string &token,
48 const std::string &value
49 );
50 std::string get_token_value() const;
51
52 bool execute() const;
53};
54
55//-----------------------------------------------------------------------------
56// StatusNotifierCommandItem
57//-----------------------------------------------------------------------------
58
59typedef boost::scoped_ptr<StatusNotifierCommand> StatusNotifierCommandItem;
60
61//-----------------------------------------------------------------------------
62
63const std::string StatusNotifierCommand::StatusToken("${status}");
64
65//-----------------------------------------------------------------------------
66
67StatusNotifierCommand::StatusNotifierCommand(
68 const std::string &
69)
70{
71}
72
73StatusNotifierCommand::~StatusNotifierCommand()
74{
75}
76
77bool StatusNotifierCommand::set_token_value(
78 const std::string &,
6c675e3a 79 const std::string &
c5db9dfd
GMF
80)
81{
82 return true;
83}
84
85std::string StatusNotifierCommand::get_token_value() const
86{
87 return std::string();
88}
89
90bool StatusNotifierCommand::execute() const
91{
92 return true;
93}
94
95#endif // STATUS_NOTIFIER_COMMAND_H