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")
121  .arg(TestToText(nOp),
122  m_fValue ? "true" : "false",
123  parm.m_fBoolVal ? "true" : "false",
124  fRes ? "true" : "false"));
125  engine->EventTriggered(this, EventTestEvent, fRes);
126 }
127 
128 // Get the variable value. Used in IndirectRef.
130 {
131  value.m_Type = MHUnion::U_Bool;
132  value.m_fBoolVal = m_fValue;
133 }
134 
135 // Implement the SetVariable action.
137 {
138  value.CheckType(MHUnion::U_Bool);
139  m_fValue = value.m_fBoolVal;
140  MHLOG(MHLogDetail, QString("Update %1 := %2")
141  .arg(m_ObjectReference.Printable(), m_fValue ? "true" : "false"));
142 }
143 
144 
146 {
147  MHVariable::Initialise(p, engine);
148  // Original value should be an int.
149  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
150 
151  if (pInitial)
152  {
153  m_nOriginalValue = pInitial->GetArgN(0)->GetIntValue();
154  }
155 }
156 
157 void MHIntegerVar::PrintMe(FILE *fd, int nTabs) const
158 {
159  PrintTabs(fd, nTabs);
160  fprintf(fd, "{:IntegerVar");
161  MHVariable::PrintMe(fd, nTabs + 1);
162  PrintTabs(fd, nTabs + 1);
163  fprintf(fd, ":OrigValue %d\n", m_nOriginalValue);
164  PrintTabs(fd, nTabs);
165  fprintf(fd, "}\n");
166 }
167 
169 {
170  if (m_fAvailable)
171  {
172  return;
173  }
174 
176  MHVariable::Preparation(engine);
177 }
178 
179 // Implement the TestVariable action. Triggers a TestEvent event on the result.
180 void MHIntegerVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
181 {
183  bool fRes = false;
184 
185  switch (nOp)
186  {
187  case TC_Equal:
188  fRes = m_nValue == parm.m_nIntVal;
189  break;
190  case TC_NotEqual:
191  fRes = m_nValue != parm.m_nIntVal;
192  break;
193  case TC_Less:
194  fRes = m_nValue < parm.m_nIntVal;
195  break;
196  case TC_LessOrEqual:
197  fRes = m_nValue <= parm.m_nIntVal;
198  break;
199  case TC_Greater:
200  fRes = m_nValue > parm.m_nIntVal;
201  break;
202  case TC_GreaterOrEqual:
203  fRes = m_nValue >= parm.m_nIntVal;
204  break;
205  default:
206  MHERROR("Invalid comparison for int"); // Shouldn't ever happen
207  }
208 
209  MHLOG(MHLogDetail, QString("Comparison %1 between %2 and %3 => %4").arg(TestToText(nOp))
210  .arg(m_nValue).arg(parm.m_nIntVal).arg(fRes ? "true" : "false"));
211  engine->EventTriggered(this, EventTestEvent, fRes);
212 }
213 
214 // Get the variable value. Used in IndirectRef.
216 {
217  value.m_Type = MHUnion::U_Int;
218  value.m_nIntVal = m_nValue;
219 }
220 
221 // Implement the SetVariable action. Also used as part of Add, Subtract etc
223 {
224  if (value.m_Type == MHUnion::U_String)
225  {
226  // Implicit conversion of string to integer.
227  int v = 0;
228  int p = 0;
229  bool fNegative = false;
230 
231  if (value.m_strVal.Size() > 0 && value.m_strVal.GetAt(0) == '-')
232  {
233  p++;
234  fNegative = true;
235  }
236 
237  for (; p < value.m_strVal.Size(); p++)
238  {
239  unsigned char ch = value.m_strVal.GetAt(p);
240 
241  if (ch < '0' || ch > '9')
242  {
243  break;
244  }
245 
246  v = v * 10 + ch - '0';
247  }
248 
249  if (fNegative)
250  {
251  m_nValue = -v;
252  }
253  else
254  {
255  m_nValue = v;
256  }
257  }
258  else
259  {
260  value.CheckType(MHUnion::U_Int);
261  m_nValue = value.m_nIntVal;
262  }
263 
264  MHLOG(MHLogDetail, QString("Update %1 := %2").arg(m_ObjectReference.Printable()).arg(m_nValue));
265 }
266 
267 
268 
270 {
271  MHVariable::Initialise(p, engine);
272  // Original value should be a string.
273  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
274 
275  if (pInitial)
276  {
277  pInitial->GetArgN(0)->GetStringValue(m_originalValue);
278  }
279 }
280 
281 void MHOctetStrVar::PrintMe(FILE *fd, int nTabs) const
282 {
283  PrintTabs(fd, nTabs);
284  fprintf(fd, "{:OStringVar");
285  MHVariable::PrintMe(fd, nTabs + 1);
286  PrintTabs(fd, nTabs + 1);
287  fprintf(fd, ":OrigValue ");
288  m_originalValue.PrintMe(fd, nTabs + 1);
289  fprintf(fd, "\n");
290  PrintTabs(fd, nTabs);
291  fprintf(fd, "}\n");
292 }
293 
295 {
296  if (m_fAvailable)
297  {
298  return;
299  }
300 
302  MHVariable::Preparation(engine);
303 }
304 
305 // Implement the TestVariable action. Triggers a TestEvent event on the result.
306 void MHOctetStrVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
307 {
309  int nRes = m_value.Compare(parm.m_strVal);
310  bool fRes = false;
311 
312  switch (nOp)
313  {
314  case TC_Equal:
315  fRes = nRes == 0;
316  break;
317  case TC_NotEqual:
318  fRes = nRes != 0;
319  break;
320  /* case TC_Less: fRes = nRes < 0; break;
321  case TC_LessOrEqual: fRes = nRes <= 0; break;
322  case TC_Greater: fRes = nRes > 0; break;
323  case TC_GreaterOrEqual: fRes = nRes >= 0; break;*/
324  default:
325  MHERROR("Invalid comparison for string"); // Shouldn't ever happen
326  }
327 
328  MHOctetString sample1(m_value, 0, 10);
329  MHOctetString sample2(parm.m_strVal, 0, 10);
330  MHLOG(MHLogDetail, QString("Comparison %1 %2 and %3 => %4")
331  .arg(TestToText(nOp), sample1.Printable(), sample2.Printable(),
332  fRes ? "true" : "false"));
333  engine->EventTriggered(this, EventTestEvent, fRes);
334 }
335 
336 // Get the variable value. Used in IndirectRef.
338 {
339  value.m_Type = MHUnion::U_String;
340  value.m_strVal.Copy(m_value);
341 }
342 
343 // Implement the SetVariable action.
345 {
346  if (value.m_Type == MHUnion::U_Int)
347  {
348  m_value.Copy(std::to_string(value.m_nIntVal).data());
349  }
350  else
351  {
353  m_value.Copy(value.m_strVal);
354  }
355 
356  // Debug
357  MHOctetString sample(m_value, 0, 60);
358  MHLOG(MHLogDetail, QString("Update %1 := %2")
359  .arg(m_ObjectReference.Printable(), sample.Printable()));
360 }
361 
362 
364 {
365  MHVariable::Initialise(p, engine);
366  // Original value should be an object reference.
367  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
368 
369  // and this should be a ObjRef node.
370  if (pInitial)
371  {
372  MHParseNode *pArg = pInitial->GetNamedArg(C_OBJECT_REFERENCE);
373 
374  if (pArg)
375  {
376  m_originalValue.Initialise(pArg->GetArgN(0), engine);
377  }
378  }
379 }
380 
381 void MHObjectRefVar::PrintMe(FILE *fd, int nTabs) const
382 {
383  PrintTabs(fd, nTabs);
384  fprintf(fd, "{:ObjectRefVar");
385  MHVariable::PrintMe(fd, nTabs + 1);
386  PrintTabs(fd, nTabs + 1);
387  fprintf(fd, ":OrigValue ");
388  m_originalValue.PrintMe(fd, nTabs + 1);
389  fprintf(fd, "\n");
390  PrintTabs(fd, nTabs);
391  fprintf(fd, "}\n");
392 }
393 
395 {
396  if (m_fAvailable)
397  {
398  return;
399  }
400 
402  MHVariable::Preparation(engine);
403 }
404 
405 // Implement the TestVariable action. Triggers a TestEvent event on the result.
406 void MHObjectRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
407 {
409  bool fRes = false;
410 
411  switch (nOp)
412  {
413  case TC_Equal:
414  fRes = m_value.Equal(parm.m_objRefVal, engine);
415  break;
416  case TC_NotEqual:
417  fRes = ! m_value.Equal(parm.m_objRefVal, engine);
418  break;
419  default:
420  MHERROR("Invalid comparison for object ref");
421  }
422 
423  engine->EventTriggered(this, EventTestEvent, fRes);
424 }
425 
426 // Get the variable value. Used in IndirectRef.
428 {
429  value.m_Type = MHUnion::U_ObjRef;
430  value.m_objRefVal.Copy(m_value);
431 }
432 
433 // Implement the SetVariable action.
435 {
437  m_value.Copy(value.m_objRefVal);
438  MHLOG(MHLogDetail, QString("Update %1 := %2")
440 }
441 
442 
444 {
445  MHVariable::Initialise(p, engine);
446  // Original value should be a content reference.
447  MHParseNode *pInitial = p->GetNamedArg(C_ORIGINAL_VALUE);
448 
449  // and this should be a ContentRef node.
450  if (pInitial)
451  {
452  MHParseNode *pArg = pInitial->GetNamedArg(C_CONTENT_REFERENCE);
453 
454  if (pArg)
455  {
456  m_originalValue.Initialise(pArg->GetArgN(0), engine);
457  }
458  }
459 }
460 
461 void MHContentRefVar::PrintMe(FILE *fd, int nTabs) const
462 {
463  PrintTabs(fd, nTabs);
464  fprintf(fd, "{:ContentRefVar");
465  MHVariable::PrintMe(fd, nTabs + 1);
466  PrintTabs(fd, nTabs + 1);
467  fprintf(fd, ":OrigValue ");
468  m_originalValue.PrintMe(fd, nTabs + 1);
469  fprintf(fd, "\n");
470  PrintTabs(fd, nTabs);
471  fprintf(fd, "}\n");
472 }
473 
475 {
476  if (m_fAvailable)
477  {
478  return;
479  }
480 
482  MHVariable::Preparation(engine);
483 }
484 
485 // Implement the TestVariable action. Triggers a TestEvent event on the result.
486 void MHContentRefVar::TestVariable(int nOp, const MHUnion &parm, MHEngine *engine)
487 {
489  bool fRes = false;
490 
491  switch (nOp)
492  {
493  case TC_Equal:
494  fRes = m_value.Equal(parm.m_contentRefVal, engine);
495  break;
496  case TC_NotEqual:
497  fRes = !m_value.Equal(parm.m_contentRefVal, engine);
498  break;
499  default:
500  MHERROR("Invalid comparison for content ref");
501  }
502 
503  engine->EventTriggered(this, EventTestEvent, fRes);
504 }
505 
506 // Get the variable value. Used in IndirectRef.
508 {
509  value.m_Type = MHUnion::U_ContentRef;
511 }
512 
513 // Implement the SetVariable action.
515 {
518  MHLOG(MHLogDetail, QString("Update %1 := %2")
520 }
521 
522 // Actions
524 {
525  MHElemAction::Initialise(p, engine); // Target
526  m_newValue.Initialise(p->GetArgN(1), engine); // Value to store
527 }
528 
530 {
531  MHObjectRef target;
532  m_target.GetValue(target, engine); // Get the target
533  MHUnion newValue;
534  newValue.GetValueFrom(m_newValue, engine); // Get the actual value to set.
535  engine->FindObject(target)->SetVariableValue(newValue); // Set the value.
536 }
537 
538 
540 {
541  MHElemAction::Initialise(p, engine); // Target
542  m_nOperator = p->GetArgN(1)->GetIntValue(); // Test to perform
543  m_comparison.Initialise(p->GetArgN(2), engine); // Value to compare against
544 }
545 
546 void MHTestVariable::PrintArgs(FILE *fd, int /*nTabs*/) const
547 {
548  fprintf(fd, " %d ", m_nOperator);
549  m_comparison.PrintMe(fd, 0);
550 }
551 
553 {
554  MHObjectRef target;
555  m_target.GetValue(target, engine); // Get the target
556  MHUnion testValue;
557  testValue.GetValueFrom(m_comparison, engine); // Get the actual value to compare.
558  engine->FindObject(target)->TestVariable(m_nOperator, testValue, engine); // Do the test.
559 }
560 
562 {
563  MHElemAction::Initialise(p, engine); // Target
564  MHParseNode *pOp = p->GetArgN(1);
565  m_operand.Initialise(pOp, engine); // Operand to add, subtract etc.
566 }
567 
569 {
570  MHUnion targetVal;
571  // Find the target and get its current value. The target can be an indirect reference.
572  MHObjectRef parm;
573  m_target.GetValue(parm, engine);
574  MHRoot *pTarget = engine->FindObject(parm);
575  pTarget->GetVariableValue(targetVal, engine);
576  targetVal.CheckType(MHUnion::U_Int);
577  // Get the value of the operand.
578  int nOperand = m_operand.GetValue(engine);
579  // Set the value of targetVal to the new value and store it.
580  targetVal.m_nIntVal = DoOp(targetVal.m_nIntVal, nOperand);
581  pTarget->SetVariableValue(targetVal);
582 }
583 
585 {
586  MHElemAction::Initialise(p, engine); // Target
587  m_operand.Initialise(p->GetArgN(1), engine); // Operand to append
588 }
589 
591 {
592  MHUnion targetVal;
593  // Find the target and get its current value. The target can be an indirect reference.
594  MHObjectRef parm;
595  m_target.GetValue(parm, engine);
596  MHRoot *pTarget = engine->FindObject(parm);
597  pTarget->GetVariableValue(targetVal, engine);
598  targetVal.CheckType(MHUnion::U_String);
599  // Get the string to append.
600  MHOctetString toAppend;
601  m_operand.GetValue(toAppend, engine);
602  targetVal.m_strVal.Append(toAppend); // Add it on the end
603  pTarget->SetVariableValue(targetVal); // Set the target to the result.
604 }
MHRoot::Activation
virtual void Activation(MHEngine *engine)
Definition: Root.cpp:70
MHContentRefVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:474
TestToText
static const char * TestToText(int tc)
Definition: Variables.cpp:34
MHObjectRef
Definition: BaseClasses.h:156
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:337
MHIngredient::Preparation
void Preparation(MHEngine *engine) override
Definition: Ingredients.cpp:159
MHSetVariable::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:529
MHRoot::m_fAvailable
bool m_fAvailable
Definition: Root.h:251
MHSetVariable::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:523
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:734
ASN1Codes.h
MHEngine
Definition: Engine.h:72
MHLogDetail
@ MHLogDetail
Definition: freemheg.h:77
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:129
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
TC_Greater
@ TC_Greater
Definition: Variables.cpp:32
MHIntegerAction::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:561
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:110
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:381
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:793
MHIntegerVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:145
MHAppend::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:584
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:539
MHUnion
Definition: BaseClasses.h:286
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:514
MHContentRefVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:443
MHOctetStrVar::Initialise
void Initialise(MHParseNode *p, MHEngine *engine) override
Definition: Variables.cpp:269
MHUnion::m_objRefVal
MHObjectRef m_objRefVal
Definition: BaseClasses.h:308
MHBooleanVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:136
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:363
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:394
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:461
MHIntegerAction::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:568
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:507
MHOctetString::Size
int Size() const
Definition: BaseClasses.h:123
MHContentRefVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:486
MHOctetStrVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:281
MHContentRefVar::m_value
MHContentRef m_value
Definition: Variables.h:146
MHParameter::Initialise
void Initialise(MHParseNode *p, MHEngine *engine)
Definition: BaseClasses.cpp:705
BaseClasses.h
MHTestVariable::PrintArgs
void PrintArgs(FILE *fd, int nTabs) const override
Definition: Variables.cpp:546
MHIntegerVar::PrintMe
void PrintMe(FILE *fd, int nTabs) const override
Definition: Variables.cpp:157
MHIntegerVar::TestVariable
void TestVariable(int nOp, const MHUnion &parmm, MHEngine *engine) override
Definition: Variables.cpp:180
MHParseNode
Definition: ParseNode.h:38
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:590
Logging.h
MHOctetStrVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:294
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:406
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:427
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:215
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:222
MHOctetStrVar::TestVariable
void TestVariable(int nOp, const MHUnion &parm, MHEngine *engine) override
Definition: Variables.cpp:306
MHTestVariable::Perform
void Perform(MHEngine *engine) override
Definition: Variables.cpp:552
MHOctetStrVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:344
MHObjectRefVar::SetVariableValue
void SetVariableValue(const MHUnion &value) override
Definition: Variables.cpp:434
MHUnion::U_Bool
@ U_Bool
Definition: BaseClasses.h:301
MHIntegerVar::Preparation
void Preparation(MHEngine *engine) override
Definition: Variables.cpp:168
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