]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changing TriggerEvent method interface to return error codes from the PushBack method...
authoraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Feb 2009 19:05:44 +0000 (19:05 +0000)
committeraszostak <aszostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Feb 2009 19:05:44 +0000 (19:05 +0000)
HLT/trigger/AliHLTTrigger.cxx
HLT/trigger/AliHLTTrigger.h

index 4d61337bf4f8cc1123377c81e5fee2989abd5eec..e44f90fc64003422c07b3f562c73a8fb011c4fbd 100644 (file)
@@ -84,21 +84,22 @@ int AliHLTTrigger::DoEvent(const AliHLTComponentEventData& evtData, AliHLTCompon
 }
 
 
-void AliHLTTrigger::TriggerEvent(bool value)
+int AliHLTTrigger::TriggerEvent(bool value)
 {
   // Sets the trigger decision for the current event.
   // See header file for more details.
   
-  if (fTriggerEventResult != 0) return;  // Do not do anything if a previous call failed.
+  if (fTriggerEventResult != 0) return fTriggerEventResult;  // Do not do anything if a previous call failed.
   AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription);
   // Append the readout list if it contains anything.
   triggerResult.TriggerDomain().Add(fReadoutList);
   fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
   if (fTriggerEventResult == 0) fDecisionMade = true;
+  return fTriggerEventResult;
 }
 
 
-void AliHLTTrigger::TriggerEvent(
+int AliHLTTrigger::TriggerEvent(
     AliHLTTriggerDecision* result, const AliHLTComponentDataType& type,
     AliHLTUInt32_t spec
   )
@@ -106,9 +107,10 @@ void AliHLTTrigger::TriggerEvent(
   // Sets a custom trigger decision for the current event.
   // See header file for more details.
   
-  if (fTriggerEventResult != 0) return;  // Do not do anything if a previous call failed.
+  if (fTriggerEventResult != 0) return fTriggerEventResult;  // Do not do anything if a previous call failed.
   fTriggerEventResult = PushBack(result, type, spec);
   if (fTriggerEventResult == 0) fDecisionMade = true;
+  return fTriggerEventResult;
 }
 
 
index 526a10ed432ad90afae3d00b54fd867149f24581..578c890143e41848726f2facc9f37c450db0a402 100644 (file)
@@ -94,8 +94,12 @@ class AliHLTTrigger : public AliHLTProcessor
    * method when a trigger decision has been made.
    * @param value  The trigger decision value. True for positive trigger and false
    *     for a negative result. (true by default)
+   * \returns zero on success and negative value on failure. The possible failure
+   *    codes are:<br>
+   *     -ENOSPC - If there is not enough output buffer space for the trigger decision.<br>
+   *     -ENOMSG - If the trigger decision object could not be serialised.
    */
-  void TriggerEvent(bool value = true);
+  int TriggerEvent(bool value = true);
   
   /**
    * Fills the output with the given trigger decision. This should be called in the
@@ -105,13 +109,24 @@ class AliHLTTrigger : public AliHLTProcessor
    *    kAliHLTDataTypeTObject|kAliHLTDataOriginOut by default).
    * @param spec  The data block specification to use (set to kAliHLTVoidDataSpec
    *    by default).
+   * \returns zero on success and negative value on failure. The possible failure
+   *    codes are:<br>
+   *     -ENOSPC - If there is not enough output buffer space for the trigger decision.<br>
+   *     -ENOMSG - If the trigger decision object could not be serialised.<br>
+   *     -EINVAL - If the <i>result</i> object is NULL.
    */
-  void TriggerEvent(
+  int TriggerEvent(
       AliHLTTriggerDecision* result,
       const AliHLTComponentDataType& type = kAliHLTDataTypeTObject|kAliHLTDataOriginOut,
       AliHLTUInt32_t spec = kAliHLTVoidDataSpec
     );
   
+  /**
+   * Method for finding out the result of the last call to TriggerEvent.
+   * \returns the error code for the last call to TriggerEvent.
+   */
+  int GetLastTriggerEventResult() const { return fTriggerEventResult; }
+  
   /**
    * Returns the event data structure for the current event.
    * NULL is returned if this method is not called inside the DoTrigger method.