InspIRCd  3.0
numeric.h
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  * Copyright (C) 2018 Sadie Powell <[email protected]>
5  * Copyright (C) 2016 Attila Molnar <[email protected]>
6  *
7  * This file is part of InspIRCd. InspIRCd is free software: you can
8  * redistribute it and/or modify it under the terms of the GNU General Public
9  * License as published by the Free Software Foundation, version 2.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14  * details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 #pragma once
22 
23 #include "numerics.h"
24 
25 namespace Numeric
26 {
27  class Numeric;
28 }
29 
31 {
34  unsigned int numeric;
35 
38  CommandBase::Params params;
39 
42  Server* sourceserver;
43 
44  public:
48  Numeric(unsigned int num)
49  : numeric(num)
50  , sourceserver(NULL)
51  {
52  }
53 
57  template <typename T>
58  Numeric& push(const T& x)
59  {
60  params.push_back(ConvToStr(x));
61  return *this;
62  }
63 
67  void SetServer(Server* server) { sourceserver = server; }
68 
72  Server* GetServer() const { return sourceserver; }
73 
77  unsigned int GetNumeric() const { return numeric; }
78 
82  const CommandBase::Params& GetParams() const { return params; }
83 
87  CommandBase::Params& GetParams() { return params; }
88 };
Numeric::Numeric::push
Numeric & push(const T &x)
Definition: numeric.h:58
Server
Definition: server.h:24
Numeric::Numeric::GetParams
const CommandBase::Params & GetParams() const
Definition: numeric.h:82
Numeric::Numeric::GetServer
Server * GetServer() const
Definition: numeric.h:72
Numeric::Numeric::Numeric
Numeric(unsigned int num)
Definition: numeric.h:48
Numeric::Numeric::GetParams
CommandBase::Params & GetParams()
Definition: numeric.h:87
Numeric::Numeric::SetServer
void SetServer(Server *server)
Definition: numeric.h:67
Numeric::Numeric::GetNumeric
unsigned int GetNumeric() const
Definition: numeric.h:77
Numeric::Numeric
Definition: numeric.h:30
CommandBase::Params
Definition: ctables.h:117