Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
fix compilation [1h]
Browse files Browse the repository at this point in the history
  • Loading branch information
ingvord authored and Ingvord committed Aug 29, 2018
1 parent a43296b commit a1228be
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 15 deletions.
11 changes: 4 additions & 7 deletions cppapi/client/devapi_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3415,10 +3415,9 @@ DeviceInfo const &DeviceProxy::info()
// command implemented for this TANGO device
//
//-----------------------------------------------------------------------------

//TODO make cmd const &
CommandInfo DeviceProxy::command_query(string cmd)
{
CommandInfo command_info;
DevCmdInfo_var cmd_info;
DevCmdInfo_2_var cmd_info_2;
DevCmdInfo_6_var cmd_info_6;
Expand Down Expand Up @@ -3509,7 +3508,7 @@ CommandInfo DeviceProxy::command_query(string cmd)
}
}

return (command_info);
assert(false);//should not reach this line
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -3568,7 +3567,6 @@ CommandInfoList *DeviceProxy::get_command_config(vector<string> &cmd_names)

CommandInfoList *DeviceProxy::command_list_query()
{
CommandInfoList *command_info_list = NULL;
DevCmdInfoList_var cmd_info_list;
DevCmdInfoList_2_var cmd_info_list_2;
DevCmdInfoList_6_var cmd_info_list_6;
Expand All @@ -3587,7 +3585,7 @@ CommandInfoList *DeviceProxy::command_list_query()
{
case 1:
dev = Device::_duplicate(device);
cmd_info_list = dev->command_list_query();
cmd_info_list = dev->command_list_query();

return newCommandInfoList(cmd_info_list);
case 2:
Expand All @@ -3605,7 +3603,6 @@ CommandInfoList *DeviceProxy::command_list_query()

return newCommandInfoList(cmd_info_list_6);
}
}
ctr = 2;
}
catch (CORBA::TRANSIENT &trans)
Expand Down Expand Up @@ -3659,7 +3656,7 @@ CommandInfoList *DeviceProxy::command_list_query()
}
}

return (command_info_list);
assert(false);
}

//-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cppapi/client/device_command_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//===================================================================================================================

#include <tango.h>
#include <tango/client/device/device_command_info.h>
#include <device_command_info.h>

namespace Tango
{
Expand Down
54 changes: 47 additions & 7 deletions cppapi/server/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,39 @@ class Command
//@}


//TODO unit tests
/**
* Set in_enum_labels from vector ref
*/
void set_in_enum_labels(vector<string> &v)
{
this->get_ext()->in_enum_labels = v;
}

/**
* Set in_enum_labels from vector rvalue
*/
void set_in_enum_labels(vector<string> &&v)
{
this->get_ext()->in_enum_labels = move(v);
}

/**
* Set in_enum_labels from vector ref
*/
void set_out_enum_labels(vector<string> &v)
{
this->get_ext()->out_enum_labels = v;
}

/**
* Set in_enum_labels from vector rvalue
*/
void set_out_enum_labels(vector<string> &&v)
{
this->get_ext()->out_enum_labels = move(v);
}

/**@name Extract methods.
* All these methods extract data from the CORBA Any object received as
* command input data
Expand Down Expand Up @@ -1228,25 +1261,32 @@ class Command
class CommandExt
{
public:
CommandExt() {}
CommandExt()
:
in_enum_labels(),
out_enum_labels()
{}

vector<string> in_enum_labels;
vector<string> out_enum_labels;
};

void alloc_any(CORBA::Any *&);
void throw_bad_type(const char *);

#ifdef HAS_UNIQUE_PTR
unique_ptr<CommandExt> ext; // Class extension
#else
CommandExt *ext;
#endif
shared_ptr<CommandExt> ext; //Class extension

//
// Ported from the extension class
//

Tango::DispLevel cmd_disp_level; // Display level
long poll_period; // Polling period

public:
shared_ptr<CommandExt> get_ext()
{
return ext;
}
};

//=============================================================================
Expand Down

0 comments on commit a1228be

Please sign in to comment.