11 #ifndef ROOT_R_TRObject
12 #define ROOT_R_TRObject
71 class TRObject:
public TObject {
72 friend SEXP Rcpp::wrap<TRObject>(
const TRObject &f);
80 TRObject(): TObject() {};
91 TRObject(SEXP robj, Bool_t status);
97 void SetStatus(Bool_t status)
117 template<
class T>
void SetAttribute(
const TString name, T obj)
119 fObj.attr(name.Data()) = obj;
128 TRObject GetAttribute(
const TString name)
130 return fObj.attr(name.Data());
133 void operator=(SEXP xx);
141 template<
class T> TRObject &Wrap(T obj)
143 fObj =::Rcpp::wrap(obj);
153 template<
class T> T As()
156 T data =::Rcpp::as<T>(fObj);
159 Error(
"Cast Operator",
"Can not make the requested data, returning an unknow value");
164 template<
class T> T operator=(TRObject &obj)
166 return ::Rcpp::as<T>(obj);
174 operator SEXP()
const
179 operator Rcpp::RObject()
184 template <
class T>
operator T()
188 T data =::Rcpp::as<T>(fObj);
191 Error(
"Cast Operator",
"Can not make the requested data, returning an unknow value");
195 ClassDef(TRObject, 0)