InspIRCd  4.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 = nullptr;
43 
44  public:
48  Numeric(unsigned int num)
49  : numeric(num)
50  {
51  }
52 
56  template <typename... Args>
57  Numeric& push(const Args&... args)
58  {
59  (params.push_back(ConvToStr(args)), ...);
60  return *this;
61  }
62 
66  void SetServer(Server* server) { sourceserver = server; }
67 
71  Server* GetServer() const { return sourceserver; }
72 
76  unsigned int GetNumeric() const { return numeric; }
77 
81  const CommandBase::Params& GetParams() const { return params; }
82 
86  CommandBase::Params& GetParams() { return params; }
87 };
Definition: ctables.h:128
Definition: numeric.h:31
Server * GetServer() const
Definition: numeric.h:71
Numeric & push(const Args &... args)
Definition: numeric.h:57
void SetServer(Server *server)
Definition: numeric.h:66
const CommandBase::Params & GetParams() const
Definition: numeric.h:81
CommandBase::Params & GetParams()
Definition: numeric.h:86
Numeric(unsigned int num)
Definition: numeric.h:48
unsigned int GetNumeric() const
Definition: numeric.h:76
Definition: server.h:25