19 for (
auto const&
method : methods_) {
22 IO->second = makeStorage(IO->first, retType);
32 : methods_(methods), retType_(retType) {
63 if (
obj.typeOf().isPointer() ||
obj.typeOf().isReference()) {
65 void**
p =
static_cast<void**
>(
obj.address());
70 obj.typeOf().deallocate(
obj.address());
77 if (retType == tVoid) {
144 val =
m.invoke(
val, IO->first);
148 for (
auto RI =
objects.rbegin(), RE =
objects.rend(); RI != RE; ++RI) {
150 RI->first.destruct(
false);
163 ret = *
static_cast<double*
>(
addr);
166 ret = *
static_cast<float*
>(
addr);
169 ret = *
static_cast<int*
>(
addr);
172 ret = *
static_cast<unsigned int*
>(
addr);
175 ret = *
static_cast<short*
>(
addr);
178 ret = *
static_cast<unsigned short*
>(
addr);
181 ret = *
static_cast<long*
>(
addr);
184 ret = *
static_cast<unsigned long*
>(
addr);
187 ret = *
static_cast<char*
>(
addr);
190 ret = *
static_cast<unsigned char*
>(
addr);
193 ret = *
static_cast<bool*
>(
addr);
196 ret = *
static_cast<int*
>(
addr);
200 assert(
false &&
"objToDouble: invalid type!");
212 std::vector<StorageManager> storage;
215 std::vector<LazyInvoker>::const_iterator
I =
methods_.begin();
216 std::vector<LazyInvoker>::const_iterator E =
methods_.end() - 1;
220 double ret =
I->invokeLast(
val, storage);
221 while (not storage.empty()) {
static ObjectWithDict byType(TypeWithDict const &)
static bool makeStorage(edm::ObjectWithDict &obj, const edm::TypeWithDict &retType)
ret
prodAgent to be discontinued
static double objToDouble(const edm::ObjectWithDict &obj, method::TypeCode type)
method::TypeCode retType_
static TypeWithDict byName(std::string const &name)
ExpressionLazyVar(const std::vector< LazyInvoker > &methods)
ExpressionVar(const std::vector< MethodInvoker > &methods, method::TypeCode retType)
std::vector< std::pair< edm::ObjectWithDict, bool > > Objects
static bool isValidReturnType(method::TypeCode)
Objects borrowObjects() const
std::vector< MethodInvoker > methods_
void returnObjects(Objects &&) const
const std::complex< double > I
~ExpressionVar() override
double value(const edm::ObjectWithDict &) const override
static void delStorage(edm::ObjectWithDict &)
double value(const edm::ObjectWithDict &) const override
Evaluate an object's method or datamember (or chain of them) to get a number.
~ExpressionLazyVar() override
oneapi::tbb::concurrent_queue< Objects > objectsCache_
Objects initObjects_() const
std::vector< LazyInvoker > methods_