The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cConditionAnd.h
Go to the documentation of this file.
1 /**
2  * @class cConditionAnd
3  * file name: cConditionAnd.h
4  * @author Betti Oesterholz
5  * @date 13.05.2011
6  * @mail webmaster@BioKom.info
7  *
8  * System: C++
9  *
10  * This class represents a and condition.
11  * Copyright (C) @c LGPL3 2011 Betti Oesterholz
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License (LGPL) as
15  * published by the Free Software Foundation, either version 3 of the
16  * License, or any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  *
26  *
27  * This class represents a and condition, wich is true if both of its
28  * subconditions is true.
29  *
30  */
31 /*
32 History:
33 13.05.2011 Oesterholz created
34 */
35 
36 #ifndef ___C_CONDITION_AND_H__
37 #define ___C_CONDITION_AND_H__
38 
39 
40 #include "version.h"
41 #include "fibDatatyps.h"
42 #include "cReadBits.h"
43 
44 #include "cConditionTwoValue.h"
45 
46 
47 using std::set;
48 
49 namespace fib{
50 
51 
53 
54 public:
55 
56  /**
57  * The constructor of the and condition.
58  *
59  * @param pInFirstSubCondition a pointer to the first condition, this condition
60  * contains; Beware: It (pSubCondition) won't be copied.
61  * @see pFirstSubCondition
62  * @param pInSecondSubCondition a pointer to the second condition, this
63  * condition contains; Beware: It (pSubCondition) won't be copied.
64  * @see pSecondSubCondition
65  * @param pInSuperiorCondition the condition which contains the
66  * new condition
67  * @param pInDefiningFibElement the Fib-element which defines/ uses
68  * the new condition
69  */
70  cConditionAnd( cCondition * pInFirstSubCondition,
71  cCondition * pInSecondSubCondition,
72  cCondition * pInSuperiorCondition = NULL,
73  cFibElement * pInDefiningFibElement = NULL );
74 
75  /**
76  * The constructor of the and condition.
77  *
78  * @param inFirstSubCondition the first condition, this condition contains
79  * @see pFirstSubCondition
80  * @param inSecondSubCondition the second condition, this condition contains
81  * @see pSecondSubCondition
82  * @param pInSuperiorCondition the condition which contains the
83  * new condition
84  * @param pInDefiningFibElement the Fib-element which defines/ uses
85  * the new condition
86  */
87  cConditionAnd( const cCondition & inFirstSubCondition,
88  const cCondition & inSecondSubCondition,
89  cCondition * pInSuperiorCondition = NULL,
90  cFibElement * pInDefiningFibElement = NULL );
91 
92  /**
93  * The copy constructor of the condition.
94  * This constructor will also copy the subconditions of the given
95  * condition.
96  *
97  * @param condition the condition which to copy
98  * @param pInSuperiorCondition the condition which contains the
99  * new condition
100  * @param pInDefiningFibElement the Fib-element which defines/ uses
101  * the new condition
102  */
103  cConditionAnd( const cConditionAnd & condition,
104  cCondition * pInSuperiorCondition = NULL,
105  cFibElement *pInDefiningFibElement = NULL );
106 
107 
108  /**
109  * The destructor of the condition.
110  */
111  virtual ~cConditionAnd();
112 
113  /**
114  * Returns the value of the condition (if it is true or false).
115  *
116  * @return true if both subconditions are true, else false
117  */
118  virtual bool getValue() const;
119 
120  /**
121  * This method duplicates this whole condition.
122  * subcondition of this condition are also cloned.
123  *
124  * @param pSuperiorCondition the condition which contains the cloned
125  * condition
126  * @param pInDefiningFibElement the Fib-element which defines/ uses
127  * the cloned condition
128  * @return the cloned/ duplicated condition
129  */
130  virtual cConditionAnd * clone(
131  cCondition * pInSuperiorCondition = NULL,
132  cFibElement *pInDefiningFibElement = NULL) const;
133 
134  /**
135  * @return the type for the condition
136  */
137  virtual unsignedIntFib getType() const;
138 
139  /**
140  * @return the name for the condition
141  */
142  virtual string getConditionName() const;
143 
144 
145 
146 protected:
147 
148  /**
149  * @return the compressed type bits for this type of condition
150  */
151  virtual char getTypeBit() const;
152 
153 };//end class cConditionAnd
154 
155 
156 }//end namespace Fib
157 
158 #endif //___C_CONDITION_AND_H__