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  m_value.Copy(std::to_string(value.m_nIntVal).data());
344  }
345  else
346  {
348  m_value.Copy(value.m_strVal);
349  }
350 
351  // Debug
352  MHOctetString sample(m_value, 0, 60);
353  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable())
354  .arg(sample.Printable()));
355 }
356 
357 
359 {
360  MHVariable::Initialise(p, engine);
361  // Original value should be an object reference.
362  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
363 
364  // and this should be a ObjRef node.
365  if (pInitial)
366  {
367  MHParseNode *pArg = pInitial->GetNamedArg(C_OBJECT_REFERENCE);
368 
369  if (pArg)
370  {
371  m_originalValue.Initialise(pArg->GetArgN(0), engine);
372  }
373  }
374 }
375 
376 void MHObjectRefVar::PrintMe(FILE *fd, int nTabs) const
377 {
378  PrintTabs(fd, nTabs);
379  fprintf(fd, "{:ObjectRefVar");
380  MHVariable::PrintMe(fd, nTabs + 1);
381  PrintTabs(fd, nTabs + 1);
382  fprintf(fd, ":OrigValue ");
383  m_originalValue.PrintMe(fd, nTabs + 1);
384  fprintf(fd, "\n");
385  PrintTabs(fd, nTabs);
386  fprintf(fd, "}\n");
387 }
388 
390 {
391  if (m_fAvailable)
392  {
393  return;
394  }
395 
397  MHVariable::Preparation(engine);
398 }
399 
400 // Implement the TestVariable action. Triggers a TestEvent event on the result.
401 void MHObjectRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
402 {
404  bool fRes = false;
405 
406  switch (nOp)
407  {
408  case TC_Equal:
409  fRes = m_value.Equal(parm.m_objRefVal, engine);
410  break;
411  case TC_NotEqual:
412  fRes = ! m_value.Equal(parm.m_objRefVal, engine);
413  break;
414  default:
415  MHERROR("Invalid comparison for object ref");
416  }
417 
418  engine->EventTriggered(this, EventTestEvent, fRes);
419 }
420 
421 // Get the variable value. Used in IndirectRef.
423 {
424  value.m_Type = MHUnion::U_ObjRef;
425  value.m_objRefVal.Copy(m_value);
426 }
427 
428 // Implement the SetVariable action.
430 {
432  m_value.Copy(value.m_objRefVal);
433  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_value.Printable()));
434 }
435 
436 
438 {
439  MHVariable::Initialise(p, engine);
440  // Original value should be a content reference.
441  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
442 
443  // and this should be a ContentRef node.
444  if (pInitial)
445  {
446  MHParseNode *pArg = pInitial->GetNamedArg(C_CONTENT_REFERENCE);
447 
448  if (pArg)
449  {
450  m_originalValue.Initialise(pArg->GetArgN(0), engine);
451  }
452  }
453 }
454 
455 void MHContentRefVar::PrintMe(FILE *fd, int nTabs) const
456 {
457  PrintTabs(fd, nTabs);
458  fprintf(fd, "{:ContentRefVar");
459  MHVariable::PrintMe(fd, nTabs + 1);
460  PrintTabs(fd, nTabs + 1);
461  fprintf(fd, ":OrigValue ");
462  m_originalValue.PrintMe(fd, nTabs + 1);
463  fprintf(fd, "\n");
464  PrintTabs(fd, nTabs);
465  fprintf(fd, "}\n");
466 }
467 
469 {
470  if (m_fAvailable)
471  {
472  return;
473  }
474 
476  MHVariable::Preparation(engine);
477 }
478 
479 // Implement the TestVariable action. Triggers a TestEvent event on the result.
480 void MHContentRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
481 {
483  bool fRes = false;
484 
485  switch (nOp)
486  {
487  case TC_Equal:
488  fRes = m_value.Equal(parm.m_contentRefVal, engine);
489  break;
490  case TC_NotEqual:
491  fRes = !m_value.Equal(parm.m_contentRefVal, engine);
492  break;
493  default:
494  MHERROR("Invalid comparison for content ref");
495  }
496 
497  engine->EventTriggered(this, EventTestEvent, fRes);
498 }
499 
500 // Get the variable value. Used in IndirectRef.
502 {
503  value.m_Type = MHUnion::U_ContentRef;
505 }
506 
507 // Implement the SetVariable action.
509 {
512  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_value.Printable()));
513 }
514 
515 // Actions
517 {
518  MHElemAction::Initialise(p, engine); // Target
519  m_newValue.Initialise(p->GetArgN(1), engine); // Value to store
520 }
521 
523 {
524  MHObjectRef target;
525  m_target.GetValue(target, engine); // Get the target
526  MHUnion newValue;
527  newValue.GetValueFrom(m_newValue, engine); // Get the actual value to set.
528  engine->FindObject(target)->SetVariableValue(newValue); // Set the value.
529 }
530 
531 
533 {
534  MHElemAction::Initialise(p, engine); // Target
535  m_nOperator = p->GetArgN(1)->GetIntValue(); // Test to perform
536  m_comparison.Initialise(p->GetArgN(2), engine); // Value to compare against
537 }
538 
539 void MHTestVariable::PrintArgs(FILE *fd, int /*nTabs*/) const
540 {
541  fprintf(fd, " %d ", m_nOperator);
542  m_comparison.PrintMe(fd, 0);
543 }
544 
546 {
547  MHObjectRef target;
548  m_target.GetValue(target, engine); // Get the target
549  MHUnion testValue;
550  testValue.GetValueFrom(m_comparison, engine); // Get the actual value to compare.
551  engine->FindObject(target)->TestVariable(m_nOperator, testValue, engine); // Do the test.
552 }
553 
555 {
556  MHElemAction::Initialise(p, engine); // Target
557  MHParseNode *pOp = p->GetArgN(1);
558  m_operand.Initialise(pOp, engine); // Operand to add, subtract etc.
559 }
560 
562 {
563  MHUnion targetVal;
564  // Find the target and get its current value. The target can be an indirect reference.
565  MHObjectRef parm;
566  m_target.GetValue(parm, engine);
567  MHRoot *pTarget = engine->FindObject(parm);
568  pTarget->GetVariableValue(targetVal, engine);
569  targetVal.CheckType(MHUnion::U_Int);
570  // Get the value of the operand.
571  int nOperand = m_operand.GetValue(engine);
572  // Set the value of targetVal to the new value and store it.
573  targetVal.m_nIntVal = DoOp(targetVal.m_nIntVal, nOperand);
574  pTarget->SetVariableValue(targetVal);
575 }
576 
578 {
579  MHElemAction::Initialise(p, engine); // Target
580  m_operand.Initialise(p->GetArgN(1), engine); // Operand to append
581 }
582 
584 {
585  MHUnion targetVal;
586  // Find the target and get its current value. The target can be an indirect reference.
587  MHObjectRef parm;
588  m_target.GetValue(parm, engine);
589  MHRoot *pTarget = engine->FindObject(parm);
590  pTarget->GetVariableValue(targetVal, engine);
591  targetVal.CheckType(MHUnion::U_String);
592  // Get the string to append.
593  MHOctetString toAppend;
594  m_operand.GetValue(toAppend, engine);
595  targetVal.m_strVal.Append(toAppend); // Add it on the end
596  pTarget->SetVariableValue(targetVal); // Set the target to the result.
597 }
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:69
MHContentRefVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:468
TestToText
static const char * TestToText(int tc)
Definition: Variables.cpp:34
MHObjectRef
Definition: BaseClasses.h:157
MHObjectRef::Copy
void Copy(const MHObjectRef &objr)
Definition: BaseClasses.cpp:323
TC_GreaterOrEqual
@ TC_GreaterOrEqual
Definition: Variables.cpp:32
MHSetVariable::m_newValue
MHParameter m_newValue
Definition: Variables.h:160
MHTestVariable::m_comparison
MHParameter m_comparison
Definition: Variables.h:173
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
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHSetVariable::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:522
MHRoot::m_fAvailable
bool m_fAvailable
Definition: Root.h:251
MHSetVariable::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:516
MHUnion::CheckType
void CheckType(enum UnionTypes t) const
Definition: BaseClasses.cpp:681
MHObjectRefVar::m_value
MHObjectRef m_value
Definition: Variables.h:125
MHParameter::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.cpp:733
ASN1Codes.h
MHEngine
Definition: Engine.h:72
MHLogDetail
@ MHLogDetail
Definition: freemheg.h:74
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:305
MHOctetString::GetAt
unsigned char GetAt(int i) const
Definition: BaseClasses.h:127
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:554
MHUnion::U_ObjRef
@ U_ObjRef
Definition: BaseClasses.h:301
MHOctetString::Compare
int Compare(const MHOctetString &str) const
Definition: BaseClasses.cpp:177
MHUnion::U_Int
@ U_Int
Definition: BaseClasses.h:301
MHRoot::SetVariableValue
virtual void SetVariableValue(const MHUnion &)
Definition: Root.h:108
MHElemAction::Initialise
virtual void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseActions.cpp:31
EventIsRunning
@ EventIsRunning
Definition: Root.h:33
MHOctetString
Definition: BaseClasses.h:111
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:376
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:306
TC_NotEqual
@ TC_NotEqual
Definition: Variables.cpp:32
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:792
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:577
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:301
MHTestVariable::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:532
MHUnion
Definition: BaseClasses.h:287
MHBooleanVar::m_fOriginalValue
bool m_fOriginalValue
Definition: Variables.h:60
hardwareprofile.config.p
p
Definition: config.py:33
Variables.h
MHAppend::m_operand
MHGenericOctetString m_operand
Definition: Variables.h:244
ParseNode.h
compat.h
MHOctetStrVar::m_value
MHOctetString m_value
Definition: Variables.h:104
MHContentRefVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:508
MHContentRefVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:437
MHOctetStrVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:265
MHUnion::m_objRefVal
MHObjectRef m_objRefVal
Definition: BaseClasses.h:308
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
MHOctetStrVar::m_originalValue
MHOctetString m_originalValue
Definition: Variables.h:104
MHObjectRefVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:358
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:389
MHEngine::FindObject
MHRoot * FindObject(const MHObjectRef &oRef, bool failOnNotFound=true)
Definition: Engine.cpp:573
MHContentRefVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:455
MHIntegerAction::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:561
MHLOG
#define MHLOG(__level, __text)
Definition: Logging.h:36
MHContentRef::Printable
QString Printable() const
Definition: BaseClasses.h:190
MHObjectRefVar::m_originalValue
MHObjectRef m_originalValue
Definition: Variables.h:125
MHContentRefVar::m_originalValue
MHContentRef m_originalValue
Definition: Variables.h:146
Engine.h
Ingredients.h
MHIntegerAction::m_operand
MHGenericInteger m_operand
Definition: Variables.h:189
TC_Less
@ TC_Less
Definition: Variables.cpp:32
MHIntegerVar::m_nOriginalValue
int m_nOriginalValue
Definition: Variables.h:82
MHIntegerAction::DoOp
virtual int DoOp(int arg1, int arg2)=0
MHUnion::GetValueFrom
void GetValueFrom(const MHParameter &value, MHEngine *engine)
Definition: BaseClasses.cpp:630
MHGenericOctetString::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:476
MHUnion::m_contentRefVal
MHContentRef m_contentRefVal
Definition: BaseClasses.h:309
MHOctetString::Printable
QString Printable() const
Definition: BaseClasses.h:131
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:501
MHOctetString::Size
int Size() const
Definition: BaseClasses.h:123
MHContentRefVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:480
MHOctetStrVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:277
MHContentRefVar::m_value
MHContentRef m_value
Definition: Variables.h:146
MHParameter::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:704
BaseClasses.h
MHTestVariable::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Variables.cpp:539
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:39
MHUnion::U_String
@ U_String
Definition: BaseClasses.h:301
MHGenericInteger::GetValue
int GetValue(MHEngine *engine) const
Definition: BaseClasses.cpp:426
MHElemAction::m_target
MHGenericObjectRef m_target
Definition: BaseActions.h:46
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:583
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:562
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:401
MHUnion::m_strVal
MHOctetString m_strVal
Definition: BaseClasses.h:307
MHContentRef::PrintMe
void PrintMe(FILE *fd, int nTabs) const
Definition: BaseClasses.h:185
MHObjectRefVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:422
MHContentRef::Copy
void Copy(const MHContentRef &cr)
Definition: BaseClasses.h:186
MHOctetString::Append
void Append(const MHOctetString &str)
Definition: BaseClasses.cpp:213
MHIntegerVar::GetVariableValue
void GetVariableValue(MHUnion &value, MHEngine *engine) override
Definition: Variables.cpp:211
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:545
MHOctetStrVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:339
MHObjectRefVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:429
MHUnion::U_Bool
@ U_Bool
Definition: BaseClasses.h:301
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:44
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