1 #include "GetAttributeCommand.h"
7 GetAttributeCommand::GetAttributeCommand(
8 const ::aurum::ReqGetAttribute* request, ::aurum::RspGetAttribute* response)
9 : mRequest{request}, mResponse{response}
13 ::grpc::Status GetAttributeCommand::execute()
15 LOG_SCOPE_F(INFO, "GetAttribute --------------- ");
16 ObjectMapper* mObjMap = ObjectMapper::getInstance();
17 UiObject* obj = mObjMap->getElement(mRequest->elementid());
19 ::aurum::ReqGetAttribute_RequestType type = mRequest->attribute();
20 AttributeGetter *getter = AttributeGetter::Creator(type);
23 getter->getPerform(obj, mResponse);
25 return grpc::Status::OK;
28 AttributeGetter* AttributeGetter::Creator(::aurum::ReqGetAttribute_RequestType type)
32 case ::aurum::ReqGetAttribute_RequestType::ReqGetAttribute_RequestType_VISIBLE:
33 return new VisibleGetter();
39 bool VisibleGetter::getPerform(UiObject *obj, ::aurum::RspGetAttribute* rsp)
41 bool isVisible = obj->isVisible();
43 rsp->set_boolvalue(isVisible);
44 rsp->set_status(aurum::RspStatus::OK);
48 AttributeGetter::~AttributeGetter(){}
49 VisibleGetter::~VisibleGetter(){}