xc
LeadingActionInfo.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. PĂ©rez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //LeadingActionInfo.hxx
22 //Information about the leading action.
23 
24 #ifndef LEADINGACTIONINFO_H
25 #define LEADINGACTIONINFO_H
26 
27 #include "utility/kernel/CommandEntity.h"
28 
29 namespace cmb_acc{
30 class Action;
31 
33 //
36  {
37  private:
38  short int index;
39 
40 // representative_value_index= -1 -> characteristic value.
41 // representative_value_index= 0 -> combination value.
42 // representative_value_index= 1 -> frequent value.
43 // representative_value_index= 2 -> quasi-permanent value.
44 
45  short int leading_representative_value_index;
46  short int general_representative_value_index;
47  public:
49  LeadingActionInfo(const short int &i= -1, const short int &lrv= -1, const short int &grv= 0);
50 
52  inline bool leadingActionExists(void) const
53  { return index>-1; }
55  inline bool isLeadingActionIndex(const short int &j) const
56  { return (index==j); }
57  inline short int getLeadingActionIndex(void) const
58  { return index; }
59  inline short int getLeadingRepresentativeValueIndex(void) const
60  { return leading_representative_value_index; }
61  inline short int getGeneralRepresentativeValueIndex(void) const
62  { return general_representative_value_index; }
63  void Print(std::ostream &os) const;
64  };
65 
66  inline std::ostream &operator<<(std::ostream &os, const LeadingActionInfo &lai)
67  {
68  lai.Print(os);
69  return os;
70  }
71 
72 } //fin namespace nmb_acc.
73 
74 #endif
Routines to generate combinations of actions.
LeadingActionInfo(const short int &i=-1, const short int &lrv=-1, const short int &grv=0)
Default constructor.
Definition: LeadingActionInfo.cc:26
Information about the leading action.
Definition: LeadingActionInfo.h:35
Objet that can execute python scripts.
Definition: CommandEntity.h:40
bool leadingActionExists(void) const
Return true if there is a leading action.
Definition: LeadingActionInfo.h:52
bool isLeadingActionIndex(const short int &j) const
Return true if the argument is the leading action index.
Definition: LeadingActionInfo.h:55
void Print(std::ostream &os) const
Print stuff.
Definition: LeadingActionInfo.cc:31