File: template.h

package info (click to toggle)
nfstrace 0.4.3.2%2Bgit20200805%2Bb220d04-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,820 kB
  • sloc: cpp: 37,393; ansic: 2,281; sh: 357; makefile: 13
file content (67 lines) | stat: -rw-r--r-- 2,413 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//------------------------------------------------------------------------------
// Author: Pavel Karneliuk
// Description: A template for headers.
// Copyright (c) 2013 EPAM Systems
//------------------------------------------------------------------------------
/*
    This file is part of Nfstrace.

    Nfstrace is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, version 2 of the License.

    Nfstrace is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Nfstrace.  If not, see <http://www.gnu.org/licenses/>.
*/
//------------------------------------------------------------------------------
#ifndef TEMPLATE_H
#define TEMPLATE_H
//------------------------------------------------------------------------------
#include <cstdint> // include language headers in alphabetical order
#include <string>
//------------------------------------------------------------------------------
#define MY_MIN(a, b) (((a) < (b)) ? (a) : (b)) //!< This is example of preprocessor usage
//------------------------------------------------------------------------------
namespace hello
{
/*! \class Represents some entity
 */
class SayHello
{
public:
    SayHello();  // May be uncommented
    ~SayHello(); // May be uncommented

    SayHello(const SayHello&) = delete;
    SayHello& operator=(const SayHello&) = delete;

    /*!  small functions may be implemented in-place
     * \return hello string
     */
    inline const std::string& say() const { return text; }
    /*! Sets some value
     * \param v - new value
     */
    void set_value(std::uint32_t v);

    /*! Returns value
     * \return value of sth
     */
    std::uint32_t get_value() const;

private:
    std::string   text;  //!< Hello phrase
    std::uint32_t value; //!< just a value for get/set methods

    static const unsigned int BAD_COFFEE; //!< Some constant
};

} // namespace hello
//------------------------------------------------------------------------------
#endif //TEMPLATE_H
//------------------------------------------------------------------------------