std::shared_ptr<Operation> Session::InvokeMethod( Instance& instance, const std::wstring& methodName, std::shared_ptr<const Instance> inboundParams) { MI_Operation op = MI_OPERATION_NULL; ::MI_Session_Invoke(&this->m_session, MI_OPERATIONFLAGS_DEFAULT_RTTI, nullptr, instance.GetNameSpace().c_str(), instance.GetClassName().c_str(), methodName.c_str(), instance.m_instance, inboundParams && inboundParams->GetElementsCount() > 0 ? inboundParams->m_instance : nullptr, nullptr, &op); return std::make_shared<Operation>(op); }
static bool IsInstanceOf(const Instance& instance, const std::wstring& className) { if (instance.GetClassName() == className) { return true; } else { auto cls = instance.GetClass()->GetParentClass(); while (cls) { if (cls->GetClassName() == className) { return true; } cls = cls->GetParentClass(); } } return false; }