00001 #ifndef MLAPI_OPERATOR_BOX_H 00002 #define MLAPI_OPERATOR_BOX_H 00003 00013 /* ******************************************************************** */ 00014 /* See the file COPYRIGHT for a complete copyright notice, contact */ 00015 /* person and disclaimer. */ 00016 /* ******************************************************************** */ 00017 00018 #include "ml_operator.h" 00019 00020 namespace MLAPI { 00021 00032 class ML_Operator_Box { 00033 00034 public: 00036 ML_Operator_Box(ML_Operator* Op, bool Ownership = true) 00037 { 00038 Op_ = Op; 00039 Ownership_ = Ownership; 00040 } 00041 00043 ~ML_Operator_Box() 00044 { 00045 if (Op_ && Ownership_) 00046 ML_Operator_Destroy(&Op_); 00047 } 00048 00050 ML_Operator* GetData() const 00051 { 00052 return(Op_); 00053 } 00054 00055 private: 00056 00058 ML_Operator* Op_; 00060 bool Ownership_; 00061 00062 }; 00063 00064 } // namespace MLAPI 00065 00066 #endif // MLAPI_OPERATOR_BOX_H