Logo ROOT  
Reference Guide
TClingValue.h
Go to the documentation of this file.
1// @(#)root/core/meta:$Id$e
2// Author: Vassil Vassilev 13/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////////////////////////////////////////////////////////////////////////////////
13// //
14// Class representing a value coming from cling. Its main use case //
15// is to TCallFunc. When TCallFunc returns by-value, i.e. a temporary //
16// variable, its lifetime has to be extended. TClingValue provides a //
17// way to extend the temporaries lifetime and gives the user to control it. //
18// //
19// The class is used to hide the implementation details of //
20// cling::Value. //
21// //
22////////////////////////////////////////////////////////////////////////////////
23
24#ifndef ROOT_TClingValue
25#define ROOT_TClingValue
26
27#include "RtypesCore.h"
28#include "TInterpreterValue.h"
29
30namespace cling {
31 class Value;
32}
33
35private:
39 void* fType;
42
44 return reinterpret_cast<cling::Value&>(fValue); }
45 const cling::Value& ToCV() const {
46 return reinterpret_cast<const cling::Value&>(fValue); }
47
48public:
50 TClingValue(const TClingValue& Other);
53
54 const void* GetValAddr() const { return &fValue; }
55 void* GetValAddr() { return &fValue; }
56
57 std::pair<std::string, std::string> ToTypeAndValueString() const;
58 Bool_t IsValid() const;
59 Double_t GetAsDouble() const;
60 Long_t GetAsLong() const;
62 void* GetAsPointer() const;
63 std::string ToString() const;
64};
65
66#endif // ROOT_TClingValue
unsigned long ULong_t
Definition: RtypesCore.h:53
long Long_t
Definition: RtypesCore.h:52
bool Bool_t
Definition: RtypesCore.h:61
double Double_t
Definition: RtypesCore.h:57
Bridge between cling::Value and ROOT.
Definition: TClingValue.h:34
void * GetAsPointer() const
Definition: TClingValue.cxx:80
std::pair< std::string, std::string > ToTypeAndValueString() const
Definition: TClingValue.cxx:47
ULong_t GetAsUnsignedLong() const
Definition: TClingValue.cxx:76
const void * GetValAddr() const
Definition: TClingValue.h:54
TClingValue & operator=(TClingValue &Other)
Definition: TClingValue.cxx:41
struct TClingValue::HasTheSameSizeAsClingValue fValue
Double_t GetAsDouble() const
Definition: TClingValue.cxx:68
void * GetValAddr()
Definition: TClingValue.h:55
const cling::Value & ToCV() const
Definition: TClingValue.h:45
cling::Value & ToCV()
Definition: TClingValue.h:43
std::string ToString() const
Definition: TClingValue.cxx:84
Long_t GetAsLong() const
Definition: TClingValue.cxx:72
Bool_t IsValid() const
Definition: TClingValue.cxx:64
const char * Value
Definition: TXMLSetup.cxx:72