// $Id: RMOVModule.cxx 7166 2005-05-02 05:09:28Z hoshina $ #include "payloads-unpacker/base/PXXObject.h" #include #include ClassImp(PXXObject) //______________________________________________________________________________ PXXObject::PXXObject() : TObject() { SetTypeName("PXXObject"); } //______________________________________________________________________________ void PXXObject::SetOwnerPtr(void *p) { // Set pointer to owner. Only the owner can execute delete for its datamembers. // You have to call it only when you create an object with "new" operator, but // don't call when you make an object with operator= or copy constructor. // All interface classes (the name will start from "PXXI") should call it // inside the Set...Ptr() functions. // fMyOwnerPtr_ = p; } //______________________________________________________________________________ void PXXObject::InitializePointer(PXXObjectPtr objptr) { // Initialize a pointer to 0. // Currently, only ROOT pointer is required initialize. // #ifdef __USEROOT__ objptr = 0; #endif } //______________________________________________________________________________ void PXXObject::Delete(PXXObjectPtr objptr) { // Delete is a wrapper function for delete operator. It deletes ROOT pointer, // but not delete shared_pointer. // It checks whether the object is owner of objptr or not: // if ((void *)this == objptr->GetOwnerPtr()) { // then delete objptr only when the if test is true. // if (!objptr) return; #ifdef __USEROOT__ // Am I an owner of objptr? if (((void *)this) == objptr->GetOwnerPtr()) { delete objptr; } #endif } #ifdef __USEROOT__ //______________________________________________________________________________ void PXXObject::log_info(const Char8b_t *va_(fmt), ...) const { // Log info to unify the logging system. // Don't use ROOT native logging TObject::Info directly to keep compativility // with IceTray. // va_list ap; va_start(ap, va_(fmt)); const char *location(""); DoError(kInfo, location, va_(fmt), ap); va_end(ap); } //______________________________________________________________________________ void PXXObject::log_warn(const Char8b_t *va_(fmt), ...) const { // Log warn to unify the logging system. // Don't use ROOT native logging TObject::Warning directly to keep compativility // with IceTray. // va_list ap; va_start(ap, va_(fmt)); const char *location(""); DoError(kWarning, location, va_(fmt), ap); va_end(ap); gROOT->Message(1001, (TObject*)this); } //______________________________________________________________________________ void PXXObject::log_error(const Char8b_t *va_(fmt), ...) const { // Log error to unify the logging system. // Don't use ROOT native logging TObject::Error directly to keep compativility // with IceTray. // va_list ap; va_start(ap, va_(fmt)); const char *location(""); DoError(kError, location, va_(fmt), ap); va_end(ap); gROOT->Message(1002, (TObject*)this); } //______________________________________________________________________________ void PXXObject::log_fatal(const Char8b_t *va_(fmt), ...) const { // Log fatal to unify the logging system. // Don't use ROOT native logging TObject::Fatal directly to keep compativility // with IceTray. // va_list ap; va_start(ap, va_(fmt)); const char *location(""); DoError(kFatal, location, va_(fmt), ap); va_end(ap); gROOT->Message(1004, (TObject*)this); } #endif // __USEROOT__