Closed Mionsz closed 7 months ago
the root cause of this is the static initialization order fiasco. I did put in a fix for it a while ago. let me check it made it into the develop branch...
yes - it's there Param accessor initializes all the Functories on first use:
ParamAccessor::ParamAccessor(DeviceModel &dm, DeviceModel::ParamAccessorData &pad, const std::string& oid)
: deviceModel_{dm}, param_{*std::get<0>(pad)}, value_{*std::get<1>(pad)}, oid_{oid}, id_{std::hash<std::string>{}(oid)} {
static bool initialized = false;
if (!initialized) {
initialized = true; // so we only do this once
// get our functories
auto &setter = Setter::getInstance();
auto &getter = Getter::getInstance();
auto &setterAt = SetterAt::getInstance();
auto &getterAt = GetterAt::getInstance();
auto &variantGetter = VariantInfoGetter::getInstance();
auto &valueGetter = ValueGetter::getInstance();
auto &valueSetter = ValueSetter::getInstance();
// register int getter
REGISTER_GETTER(KindCase::kInt32Value, int32_value, int32_t);
// register float getter
REGISTER_GETTER(KindCase::kFloat32Value, float32_value, float);
// etc
can you ensure you're up to date with the latest develop branch?
I will check it.
I just pulled develop and built from scratch. it runs fine for me. but I'm on macOS with CLANG, not ubuntu with gcc. However, the version of full_service I have doesn't yet have your refactoring in it. Are you building from develop or your PR?
I am building from develop first so that I know it works as intended. I am using docker with no-cache flag and commit:
Param accessor setValue fails for each type: