MythTV  master
Variables.cpp
Go to the documentation of this file.
1 /* Variables.cpp
2 
3  Copyright (C) David C. J. Matthews 2004 dm at prolingua.co.uk
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  as published by the Free Software Foundation; either version 2
8  of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18  Or, point your browser to http://www.gnu.org/copyleft/gpl.html
19 
20 */
21 #include "compat.h"
22 
23 #include "Variables.h"
24 #include "Ingredients.h"
25 #include "Root.h"
26 #include "BaseClasses.h"
27 #include "ParseNode.h"
28 #include "ASN1Codes.h"
29 #include "Engine.h"
30 #include "Logging.h"
31 
33 
34 static const char *TestToText(int tc)
35 {
36  switch (tc)
37  {
38  case TC_Equal:
39  return "Equal";
40  case TC_NotEqual:
41  return "NotEqual";
42  case TC_Less:
43  return "Less";
44  case TC_LessOrEqual:
45  return "LessOrEqual";
46  case TC_Greater:
47  return "Greater";
48  case TC_GreaterOrEqual:
49  return "GreaterOrEqual";
50  }
51 
52  return nullptr; // To keep the compiler happy
53 }
54 
55 // Normal activation behaviour.
57 {
58  if (m_fRunning)
59  {
60  return;
61  }
62 
64  m_fRunning = true;
65  engine->EventTriggered(this, EventIsRunning);
66 }
67 
69 {
70  MHVariable::Initialise(p, engine);
71  // Original value should be a bool.
72  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
73 
74  if (pInitial)
75  {
76  m_fOriginalValue = pInitial->GetArgN(0)->GetBoolValue();
77  }
78 }
79 
80 void MHBooleanVar::PrintMe(FILE *fd, int nTabs) const
81 {
82  PrintTabs(fd, nTabs);
83  fprintf(fd, "{:BooleanVar");
84  MHVariable::PrintMe(fd, nTabs + 1);
85  PrintTabs(fd, nTabs + 1);
86  fprintf(fd, ":OrigValue %s\n", m_fOriginalValue ? "true" : "false");
87  PrintTabs(fd, nTabs);
88  fprintf(fd, "}\n");
89 }
90 
92 {
93  if (m_fAvailable)
94  {
95  return;
96  }
97 
100 }
101 
102 // Implement the TestVariable action. Triggers a TestEvent event on the result.
103 void MHBooleanVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
104 {
106  bool fRes = false;
107 
108  switch (nOp)
109  {
110  case TC_Equal:
111  fRes = m_fValue == parm.m_fBoolVal;
112  break;
113  case TC_NotEqual:
114  fRes = m_fValue != parm.m_fBoolVal;
115  break;
116  default:
117  MHERROR("Invalid comparison for bool");
118  }
119 
120  MHLOG(MHLogDetail, QString("Comparison %1 between %2 and %3 => %4").arg(TestToText(nOp))
121  .arg(m_fValue ? "true" : "false").arg(parm.m_fBoolVal ? "true" : "false").arg(fRes ? "true" : "false"));
122  engine->EventTriggered(this, EventTestEvent, fRes);
123 }
124 
125 // Get the variable value. Used in IndirectRef.
127 {
128  value.m_Type = MHUnion::U_Bool;
129  value.m_fBoolVal = m_fValue;
130 }
131 
132 // Implement the SetVariable action.
134 {
135  value.CheckType(MHUnion::U_Bool);
136  m_fValue = value.m_fBoolVal;
137  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_fValue ? "true" : "false"));
138 }
139 
140 
142 {
143  MHVariable::Initialise(p, engine);
144  // Original value should be an int.
145  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
146 
147  if (pInitial)
148  {
149  m_nOriginalValue = pInitial->GetArgN(0)->GetIntValue();
150  }
151 }
152 
153 void MHIntegerVar::PrintMe(FILE *fd, int nTabs) const
154 {
155  PrintTabs(fd, nTabs);
156  fprintf(fd, "{:IntegerVar");
157  MHVariable::PrintMe(fd, nTabs + 1);
158  PrintTabs(fd, nTabs + 1);
159  fprintf(fd, ":OrigValue %d\n", m_nOriginalValue);
160  PrintTabs(fd, nTabs);
161  fprintf(fd, "}\n");
162 }
163 
165 {
166  if (m_fAvailable)
167  {
168  return;
169  }
170 
172  MHVariable::Preparation(engine);
173 }
174 
175 // Implement the TestVariable action. Triggers a TestEvent event on the result.
176 void MHIntegerVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
177 {
179  bool fRes = false;
180 
181  switch (nOp)
182  {
183  case TC_Equal:
184  fRes = m_nValue == parm.m_nIntVal;
185  break;
186  case TC_NotEqual:
187  fRes = m_nValue != parm.m_nIntVal;
188  break;
189  case TC_Less:
190  fRes = m_nValue < parm.m_nIntVal;
191  break;
192  case TC_LessOrEqual:
193  fRes = m_nValue <= parm.m_nIntVal;
194  break;
195  case TC_Greater:
196  fRes = m_nValue > parm.m_nIntVal;
197  break;
198  case TC_GreaterOrEqual:
199  fRes = m_nValue >= parm.m_nIntVal;
200  break;
201  default:
202  MHERROR("Invalid comparison for int"); // Shouldn't ever happen
203  }
204 
205  MHLOG(MHLogDetail, QString("Comparison %1 between %2 and %3 => %4").arg(TestToText(nOp))
206  .arg(m_nValue).arg(parm.m_nIntVal).arg(fRes ? "true" : "false"));
207  engine->EventTriggered(this, EventTestEvent, fRes);
208 }
209 
210 // Get the variable value. Used in IndirectRef.
212 {
213  value.m_Type = MHUnion::U_Int;
214  value.m_nIntVal = m_nValue;
215 }
216 
217 // Implement the SetVariable action. Also used as part of Add, Subtract etc
219 {
220  if (value.m_Type == MHUnion::U_String)
221  {
222  // Implicit conversion of string to integer.
223  int v = 0;
224  int p = 0;
225  bool fNegative = false;
226 
227  if (value.m_StrVal.Size() > 0 && value.m_StrVal.GetAt(0) == '-')
228  {
229  p++;
230  fNegative = true;
231  }
232 
233  for (; p < value.m_StrVal.Size(); p++)
234  {
235  unsigned char ch = value.m_StrVal.GetAt(p);
236 
237  if (ch < '0' || ch > '9')
238  {
239  break;
240  }
241 
242  v = v * 10 + ch - '0';
243  }
244 
245  if (fNegative)
246  {
247  m_nValue = -v;
248  }
249  else
250  {
251  m_nValue = v;
252  }
253  }
254  else
255  {
256  value.CheckType(MHUnion::U_Int);
257  m_nValue = value.m_nIntVal;
258  }
259 
260  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_nValue));
261 }
262 
263 
264 
266 {
267  MHVariable::Initialise(p, engine);
268  // Original value should be a string.
269  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
270 
271  if (pInitial)
272  {
273  pInitial->GetArgN(0)->GetStringValue(m_OriginalValue);
274  }
275 }
276 
277 void MHOctetStrVar::PrintMe(FILE *fd, int nTabs) const
278 {
279  PrintTabs(fd, nTabs);
280  fprintf(fd, "{:OStringVar");
281  MHVariable::PrintMe(fd, nTabs + 1);
282  PrintTabs(fd, nTabs + 1);
283  fprintf(fd, ":OrigValue ");
284  m_OriginalValue.PrintMe(fd, nTabs + 1);
285  fprintf(fd, "\n");
286  PrintTabs(fd, nTabs);
287  fprintf(fd, "}\n");
288 }
289 
291 {
292  if (m_fAvailable)
293  {
294  return;
295  }
296 
298  MHVariable::Preparation(engine);
299 }
300 
301 // Implement the TestVariable action. Triggers a TestEvent event on the result.
302 void MHOctetStrVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
303 {
305  int nRes = m_Value.Compare(parm.m_StrVal);
306  bool fRes = false;
307 
308  switch (nOp)
309  {
310  case TC_Equal:
311  fRes = nRes == 0;
312  break;
313  case TC_NotEqual:
314  fRes = nRes != 0;
315  break;
316  /* case TC_Less: fRes = nRes < 0; break;
317  case TC_LessOrEqual: fRes = nRes <= 0; break;
318  case TC_Greater: fRes = nRes > 0; break;
319  case TC_GreaterOrEqual: fRes = nRes >= 0; break;*/
320  default:
321  MHERROR("Invalid comparison for string"); // Shouldn't ever happen
322  }
323 
324  MHOctetString sample1(m_Value, 0, 10);
325  MHOctetString sample2(parm.m_StrVal, 0, 10);
326  MHLOG(MHLogDetail, QString("Comparison %1 %2 and %3 => %4").arg(TestToText(nOp))
327  .arg(sample1.Printable()).arg(sample2.Printable()).arg(fRes ? "true" : "false"));
328  engine->EventTriggered(this, EventTestEvent, fRes);
329 }
330 
331 // Get the variable value. Used in IndirectRef.
333 {
334  value.m_Type = MHUnion::U_String;
335  value.m_StrVal.Copy(m_Value);
336 }
337 
338 // Implement the SetVariable action.
340 {
341  if (value.m_Type == MHUnion::U_Int)
342  {
343  // Implicit conversion of int to string.
344  char buff[30]; // 30 chars is more than enough.
345  snprintf(buff, sizeof(buff), "%0d", value.m_nIntVal);
346  m_Value.Copy(buff);
347  }
348  else
349  {
351  m_Value.Copy(value.m_StrVal);
352  }
353 
354  // Debug
355  MHOctetString sample(m_Value, 0, 60);
356  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable())
357  .arg(sample.Printable()));
358 }
359 
360 
362 {
363  MHVariable::Initialise(p, engine);
364  // Original value should be an object reference.
365  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
366 
367  // and this should be a ObjRef node.
368  if (pInitial)
369  {
370  MHParseNode *pArg = pInitial->GetNamedArg(C_OBJECT_REFERENCE);
371 
372  if (pArg)
373  {
374  m_OriginalValue.Initialise(pArg->GetArgN(0), engine);
375  }
376  }
377 }
378 
379 void MHObjectRefVar::PrintMe(FILE *fd, int nTabs) const
380 {
381  PrintTabs(fd, nTabs);
382  fprintf(fd, "{:ObjectRefVar");
383  MHVariable::PrintMe(fd, nTabs + 1);
384  PrintTabs(fd, nTabs + 1);
385  fprintf(fd, ":OrigValue ");
386  m_OriginalValue.PrintMe(fd, nTabs + 1);
387  fprintf(fd, "\n");
388  PrintTabs(fd, nTabs);
389  fprintf(fd, "}\n");
390 }
391 
393 {
394  if (m_fAvailable)
395  {
396  return;
397  }
398 
400  MHVariable::Preparation(engine);
401 }
402 
403 // Implement the TestVariable action. Triggers a TestEvent event on the result.
404 void MHObjectRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
405 {
407  bool fRes = false;
408 
409  switch (nOp)
410  {
411  case TC_Equal:
412  fRes = m_Value.Equal(parm.m_ObjRefVal, engine);
413  break;
414  case TC_NotEqual:
415  fRes = ! m_Value.Equal(parm.m_ObjRefVal, engine);
416  break;
417  default:
418  MHERROR("Invalid comparison for object ref");
419  }
420 
421  engine->EventTriggered(this, EventTestEvent, fRes);
422 }
423 
424 // Get the variable value. Used in IndirectRef.
426 {
427  value.m_Type = MHUnion::U_ObjRef;
428  value.m_ObjRefVal.Copy(m_Value);
429 }
430 
431 // Implement the SetVariable action.
433 {
435  m_Value.Copy(value.m_ObjRefVal);
436  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_Value.Printable()));
437 }
438 
439 
441 {
442  MHVariable::Initialise(p, engine);
443  // Original value should be a content reference.
444  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
445 
446  // and this should be a ContentRef node.
447  if (pInitial)
448  {
449  MHParseNode *pArg = pInitial->GetNamedArg(C_CONTENT_REFERENCE);
450 
451  if (pArg)
452  {
453  m_OriginalValue.Initialise(pArg->GetArgN(0), engine);
454  }
455  }
456 }
457 
458 void MHContentRefVar::PrintMe(FILE *fd, int nTabs) const
459 {
460  PrintTabs(fd, nTabs);
461  fprintf(fd, "{:ContentRefVar");
462  MHVariable::PrintMe(fd, nTabs + 1);
463  PrintTabs(fd, nTabs + 1);
464  fprintf(fd, ":OrigValue ");
465  m_OriginalValue.PrintMe(fd, nTabs + 1);
466  fprintf(fd, "\n");
467  PrintTabs(fd, nTabs);
468  fprintf(fd, "}\n");
469 }
470 
472 {
473  if (m_fAvailable)
474  {
475  return;
476  }
477 
479  MHVariable::Preparation(engine);
480 }
481 
482 // Implement the TestVariable action. Triggers a TestEvent event on the result.
483 void MHContentRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
484 {
486  bool fRes = false;
487 
488  switch (nOp)
489  {
490  case TC_Equal:
491  fRes = m_Value.Equal(parm.m_ContentRefVal, engine);
492  break;
493  case TC_NotEqual:
494  fRes = !m_Value.Equal(parm.m_ContentRefVal, engine);
495  break;
496  default:
497  MHERROR("Invalid comparison for content ref");
498  }
499 
500  engine->EventTriggered(this, EventTestEvent, fRes);
501 }
502 
503 // Get the variable value. Used in IndirectRef.
505 {
506  value.m_Type = MHUnion::U_ContentRef;
508 }
509 
510 // Implement the SetVariable action.
512 {
515  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_Value.Printable()));
516 }
517 
518 // Actions
520 {
521  MHElemAction::Initialise(p, engine); // Target
522  m_NewValue.Initialise(p->GetArgN(1), engine); // Value to store
523 }
524 
526 {
527  MHObjectRef target;
528  m_Target.GetValue(target, engine); // Get the target
529  MHUnion newValue;
530  newValue.GetValueFrom(m_NewValue, engine); // Get the actual value to set.
531  engine->FindObject(target)->SetVariableValue(newValue); // Set the value.
532 }
533 
534 
536 {
537  MHElemAction::Initialise(p, engine); // Target
538  m_nOperator = p->GetArgN(1)->GetIntValue(); // Test to perform
539  m_Comparison.Initialise(p->GetArgN(2), engine); // Value to compare against
540 }
541 
542 void MHTestVariable::PrintArgs(FILE *fd, int /*nTabs*/) const
543 {
544  fprintf(fd, " %d ", m_nOperator);
545  m_Comparison.PrintMe(fd, 0);
546 }
547 
549 {
550  MHObjectRef target;
551  m_Target.GetValue(target, engine); // Get the target
552  MHUnion testValue;
553  testValue.GetValueFrom(m_Comparison, engine); // Get the actual value to compare.
554  engine->FindObject(target)->TestVariable(m_nOperator, testValue, engine); // Do the test.
555 }
556 
558 {
559  MHElemAction::Initialise(p, engine); // Target
560  MHParseNode *pOp = p->GetArgN(1);
561  m_Operand.Initialise(pOp, engine); // Operand to add, subtract etc.
562 }
563 
565 {
566  MHUnion targetVal;
567  // Find the target and get its current value. The target can be an indirect reference.
568  MHObjectRef parm;
569  m_Target.GetValue(parm, engine);
570  MHRoot *pTarget = engine->FindObject(parm);
571  pTarget->GetVariableValue(targetVal, engine);
572  targetVal.CheckType(MHUnion::U_Int);
573  // Get the value of the operand.
574  int nOperand = m_Operand.GetValue(engine);
575  // Set the value of targetVal to the new value and store it.
576  targetVal.m_nIntVal = DoOp(targetVal.m_nIntVal, nOperand);
577  pTarget->SetVariableValue(targetVal);
578 }
579 
581 {
582  MHElemAction::Initialise(p, engine); // Target
583  m_Operand.Initialise(p->GetArgN(1), engine); // Operand to append
584 }
585 
587 {
588  MHUnion targetVal;
589  // Find the target and get its current value. The target can be an indirect reference.
590  MHObjectRef parm;
591  m_Target.GetValue(parm, engine);
592  MHRoot *pTarget = engine->FindObject(parm);
593  pTarget->GetVariableValue(targetVal, engine);
594  targetVal.CheckType(MHUnion::U_String);
595  // Get the string to append.
596  MHOctetString toAppend;
597  m_Operand.GetValue(toAppend, engine);
598  targetVal.m_StrVal.Append(toAppend); // Add it on the end
599  pTarget->SetVariableValue(targetVal); // Set the target to the result.
600 }
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
MHContentRefVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:471
TestToText
static const char * TestToText(int tc)
Definition: Variables.cpp:34
MHObjectRef
Definition: BaseClasses.h:152
MHSetVariable::m_NewValue
MHParameter m_NewValue
Definition: Variables.h:160
MHObjectRef::Copy
void Copy(const MHObjectRef &objr)
Definition: BaseClasses.cpp:323
TC_GreaterOrEqual
@ TC_GreaterOrEqual
Definition: Variables.cpp:32
MHVariable::Activation
void Activation(MHEngine *engine) override
Definition: Variables.cpp:56
EventTestEvent
@ EventTestEvent
Definition: Root.h:37
MHObjectRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:278
MHOctetStrVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:332
MHObjectRefVar::m_Value
MHObjectRef m_Value
Definition: Variables.h:125
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHSetVariable::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:525
MHRoot::m_fAvailable
bool m_fAvailable
Definition: Root.h:251
MHSetVariable::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:519
MHUnion::CheckType
void CheckType(enum UnionTypes t) const
Definition: BaseClasses.cpp:687
MHParameter::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:739
ASN1Codes.h
MHEngine
Definition: Engine.h:72
MHUnion::m_ObjRefVal
MHObjectRef m_ObjRefVal
Definition: BaseClasses.h:304
MHLogDetail
@ MHLogDetail
Definition: freemheg.h:71
MHParseNode::GetIntValue
int GetIntValue()
Definition: ParseNode.cpp:170
MHBooleanVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:103
MHIngredient::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Ingredients.cpp:49
MHUnion::m_nIntVal
int m_nIntVal
Definition: BaseClasses.h:301
MHOctetString::GetAt
unsigned char GetAt(int i) const
Definition: BaseClasses.h:123
MHBooleanVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:126
MHBooleanVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:68
MHGenericInteger::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:397
arg
arg(title).arg(filename).arg(doDelete))
TC_Greater
@ TC_Greater
Definition: Variables.cpp:32
MHIntegerAction::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:557
MHUnion::U_ObjRef
@ U_ObjRef
Definition: BaseClasses.h:297
MHOctetString::Compare
int Compare(const MHOctetString &str) const
Definition: BaseClasses.cpp:177
MHUnion::U_Int
@ U_Int
Definition: BaseClasses.h:297
MHRoot::SetVariableValue
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
MHElemAction::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
MHOctetStrVar::m_Value
MHOctetString m_Value
Definition: Variables.h:104
EventIsRunning
@ EventIsRunning
Definition: Root.h:33
MHOctetString
Definition: BaseClasses.h:106
MHRoot::TestVariable
virtual void TestVariable(int, const MHUnion &, MHEngine *)
Definition: Root.h:104
MHObjectRefVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:379
mythburn.FILE
int FILE
Definition: mythburn.py:139
MHOctetString::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:154
MHUnion::m_fBoolVal
bool m_fBoolVal
Definition: BaseClasses.h:302
TC_NotEqual
@ TC_NotEqual
Definition: Variables.cpp:32
MHObjectRefVar::m_OriginalValue
MHObjectRef m_OriginalValue
Definition: Variables.h:125
MHBooleanVar::m_fValue
bool m_fValue
Definition: Variables.h:61
TC_LessOrEqual
@ TC_LessOrEqual
Definition: Variables.cpp:32
MHObjectRef::Equal
bool Equal(const MHObjectRef &objr, MHEngine *engine) const
Definition: BaseClasses.cpp:331
MHRoot::m_fRunning
bool m_fRunning
Definition: Root.h:252
MHRoot::m_ObjectReference
MHObjectRef m_ObjectReference
Definition: Root.h:247
MHContentRef::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:798
MHIntegerVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:141
MHAppend::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:580
MHIntegerVar::m_nValue
int m_nValue
Definition: Variables.h:83
MHEngine::EventTriggered
void EventTriggered(MHRoot *pSource, enum EventType ev)
Definition: Engine.h:94
MHUnion::U_ContentRef
@ U_ContentRef
Definition: BaseClasses.h:297
MHTestVariable::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:535
MHIntegerAction::m_Operand
MHGenericInteger m_Operand
Definition: Variables.h:189
MHUnion
Definition: BaseClasses.h:282
MHBooleanVar::m_fOriginalValue
bool m_fOriginalValue
Definition: Variables.h:60
hardwareprofile.config.p
p
Definition: config.py:33
Variables.h
ParseNode.h
compat.h
MHContentRefVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:511
MHContentRefVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:440
MHOctetStrVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:265
MHBooleanVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:133
PrintTabs
void PrintTabs(FILE *fd, int n)
Definition: ParseNode.cpp:34
MHGenericOctetString::GetValue
void GetValue(MHOctetString &str, MHEngine *engine) const
Definition: BaseClasses.cpp:505
MHParseNode::GetArgN
MHParseNode * GetArgN(int n)
Definition: ParseNode.cpp:78
MHObjectRefVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:361
MHIngredient::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Ingredients.cpp:107
MHTestVariable::m_nOperator
int m_nOperator
Definition: Variables.h:172
TestCodes
TestCodes
Definition: Variables.cpp:32
MHObjectRefVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:392
MHEngine::FindObject
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:574
MHContentRefVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:458
MHContentRefVar::m_Value
MHContentRef m_Value
Definition: Variables.h:146
MHIntegerAction::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:564
MHLOG
#define MHLOG(__level, __text)
Definition: Logging.h:36
MHContentRef::Printable
QString Printable() const
Definition: BaseClasses.h:186
MHContentRefVar::m_OriginalValue
MHContentRef m_OriginalValue
Definition: Variables.h:146
Engine.h
MHElemAction::m_Target
MHGenericObjectRef m_Target
Definition: BaseActions.h:46
Ingredients.h
TC_Less
@ TC_Less
Definition: Variables.cpp:32
MHIntegerVar::m_nOriginalValue
int m_nOriginalValue
Definition: Variables.h:82
MHTestVariable::m_Comparison
MHParameter m_Comparison
Definition: Variables.h:173
MHIntegerAction::DoOp
virtual int DoOp(int arg1, int arg2)=0
MHUnion::GetValueFrom
void GetValueFrom(const MHParameter &value, MHEngine *engine)
Definition: BaseClasses.cpp:636
MHGenericOctetString::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:476
MHOctetString::Printable
QString Printable() const
Definition: BaseClasses.h:127
MHOctetStrVar::m_OriginalValue
MHOctetString m_OriginalValue
Definition: Variables.h:104
MHParseNode::GetNamedArg
MHParseNode * GetNamedArg(int nTag)
Definition: ParseNode.cpp:110
C_OBJECT_REFERENCE
#define C_OBJECT_REFERENCE
Definition: ASN1Codes.h:101
MHParseNode::GetBoolValue
bool GetBoolValue()
Definition: ParseNode.cpp:192
Root.h
MHContentRefVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:504
MHOctetString::Size
int Size() const
Definition: BaseClasses.h:119
MHContentRefVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:483
MHOctetStrVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:277
MHParameter::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:710
BaseClasses.h
MHTestVariable::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Variables.cpp:542
MHIntegerVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:153
MHIntegerVar::TestVariable
void TestVariable(int nOp, const MHUnion &parmm, MHEngine *engine) override
Definition: Variables.cpp:176
MHParseNode
Definition: ParseNode.h:38
MHUnion::U_String
@ U_String
Definition: BaseClasses.h:297
MHUnion::m_StrVal
MHOctetString m_StrVal
Definition: BaseClasses.h:303
MHGenericInteger::GetValue
int GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:426
MHUnion::m_ContentRefVal
MHContentRef m_ContentRefVal
Definition: BaseClasses.h:305
MHParseNode::GetStringValue
void GetStringValue(MHOctetString &str)
Definition: ParseNode.cpp:203
MHBooleanVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:80
MHERROR
#define MHERROR(__text)
Definition: Logging.h:42
MHAppend::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:586
Logging.h
MHOctetStrVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:290
TC_Equal
@ TC_Equal
Definition: Variables.cpp:32
MHGenericObjectRef::GetValue
void GetValue(MHObjectRef &ref, MHEngine *engine) const
Definition: BaseClasses.cpp:568
MHContentRef::Equal
bool Equal(const MHContentRef &cr, MHEngine *engine) const
Definition: BaseClasses.cpp:336
MHObjectRefVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:404
MHContentRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.h:181
MHObjectRefVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:425
MHContentRef::Copy
void Copy(const MHContentRef &cr)
Definition: BaseClasses.h:182
MHOctetString::Append
void Append(const MHOctetString &str)
Definition: BaseClasses.cpp:213
MHIntegerVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:211
MHAppend::m_Operand
MHGenericOctetString m_Operand
Definition: Variables.h:244
MHObjectRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:299
C_ORIGINAL_VALUE
#define C_ORIGINAL_VALUE
Definition: ASN1Codes.h:100
MHIntegerVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:218
MHOctetStrVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:302
MHTestVariable::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:548
MHOctetStrVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:339
MHObjectRefVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:432
MHUnion::U_Bool
@ U_Bool
Definition: BaseClasses.h:297
MHIntegerVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:164
MHOctetString::Copy
void Copy(const MHOctetString &str)
Definition: BaseClasses.cpp:131
MHRoot
Definition: Root.h:43
C_CONTENT_REFERENCE
#define C_CONTENT_REFERENCE
Definition: ASN1Codes.h:102
MHRoot::GetVariableValue
virtual void GetVariableValue(MHUnion &, MHEngine *)
Definition: Root.h:106
MHBooleanVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:91
MHObjectRef::Printable
QString Printable() const
Definition: BaseClasses.cpp:313