Ejemplo n.º 1
0
void Connection::Cb_Cmd_Request(CORBA::Request_ptr req,Tango::CallBack *cb_ptr)
{

	DeviceData data_out;
	Tango::DevErrorList errors(2);
	errors.length(0);

	CORBA::NVList_ptr req_arg = req->arguments();
	const char *cmd = NULL;
	CORBA::NamedValue_ptr nv = req_arg->item(0);
	*(nv->value()) >>= cmd;

//
// Check if the reply is an exception
//

	CORBA::Environment_ptr env = req->env();
	if (!CORBA::is_nil(env) && (env->exception() == NULL))
	{

//
// Get received value
//

		const CORBA::Any *received;
		CORBA::Any &dii_any = req->return_value();
		dii_any >>= received;
		CORBA::Any *server_any = new CORBA::Any(*received);

		data_out.any = server_any;
	}
	else
	{
void 
StandardConfiguratorImpl::configure(::Components::CCMObject_ptr comp)
throw( Components::WrongComponentType )
{
	for(CORBA::ULong i = 0; i < config_.length(); i++ )
	{
		DEBUG_OUT2( "\nStandardConfigurator: configure ", config_[i]->name() );


		// create a request according to the wire format of attribute operations
		std::string operation = "_set_";
		operation.append( config_[i]->name() );
		CORBA::Request_ptr request = comp->_request( operation.c_str() );
		request->add_in_arg() = config_[i]->value();


		// send the request
		try
		{
 			request->invoke();
		}
		catch( CORBA::SystemException& ex )
		{
 			std::cerr << "StandardConfigurator: Unexpected System Exception" << &ex << std::endl;
		}


		// check for exceptions
		CORBA::Exception* ex = request->env()->exception();
		if ( ex != 0 )
		{
			std::cerr << "StandardConfigurator: Exception during configuration : " << ex << std::endl;
		}
	}
}