ROOT  6.06/09
Reference Guide
TClingValue.cxx
Go to the documentation of this file.
1 // @(#)root/core/meta:$Id$
2 // Author: Vassil Vassilev 14/03/2013
3 
4 /*******************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  ******************************************************************************/
11 
12 /** \class TClingValue
13 Bridge between cling::Value and ROOT.
14 */
15 
16 #include "TClingValue.h"
17 
18 #include "cling/Interpreter/Value.h"
19 #include <cassert>
20 
22  // We default initialize to invalid value to keep a "sane" state.
23  assert(sizeof(fValue) >= sizeof(cling::Value)
24  && "sizeof(fValue) too small!");
25  new (&fValue) cling::Value();
26 }
27 
30  assert(sizeof(fValue) >= sizeof(cling::Value)
31  && "sizeof(fValue) too small!");
32  new (&fValue) cling::Value(Other.ToCV());
33 }
34 
36  ToCV().~Value();
37 }
38 
40  using namespace cling;
41  ToCV() = Other.ToCV();
42  return *this;
43 }
44 
46  return ToCV().isValid();
47 }
48 
50  return ToCV().getDouble();
51 }
52 
54  return ToCV().getLL();
55 }
56 
58  return ToCV().getULL();
59 }
60 
62  return ToCV().getPtr();
63 }
struct TClingValue::HasTheSameSizeAsClingValue fValue
#define assert(cond)
Definition: unittest.h:542
void * GetAsPointer() const
Definition: TClingValue.cxx:61
bool Bool_t
Definition: RtypesCore.h:59
Long_t GetAsLong() const
Definition: TClingValue.cxx:53
Double_t GetAsDouble() const
Definition: TClingValue.cxx:49
TClingValue & operator=(TClingValue &Other)
Definition: TClingValue.cxx:39
ULong_t GetAsUnsignedLong() const
Definition: TClingValue.cxx:57
long Long_t
Definition: RtypesCore.h:50
double Double_t
Definition: RtypesCore.h:55
Definition: TDatime.h:114
unsigned long ULong_t
Definition: RtypesCore.h:51
Bool_t IsValid() const
Definition: TClingValue.cxx:45
cling::Value & ToCV()
Definition: TClingValue.h:47
Bridge between cling::Value and ROOT.
Definition: TClingValue.h:38
const char * Value
Definition: TXMLSetup.cxx:73