Jump to content
OpenSplice DDS Forum
Sign in to follow this  
bonjefir

Setter and Getter for IDLs' values

Recommended Posts

Hi

 

I have an IDL as follows:

module myPacket 
{
	module Building
	{
		module IDL_Floor
		{
			struct Sensors
			{
				boolean enable;
				float bonjefir;
			};
#pragma keylist Sensors enable
		};
	};
};

In my code, I try to set a value for the float variable "bonjefir" as follows:

myPacket::Building::IDL_Floor::Sensors data;
data.bonjefir(100);

But getting the following error:

error: call of overloaded 'bonjefir(int)' is ambiguous

I can solve this problem by modifying the files generated by "idlpp" command:

file <myIDL.h>
...
               DDS::Float bonjefir() const { return this->bonefir_; }
               DDS::Float& bonjefir() { return this->bonjefir_; }
               void bonjrfir(DDS::Float _val_) { this->bonjefir_ = _val_; }
#ifdef OSPL_DDS_CXX11
               void bonjefir(DDS::Float&& _val_) { this->bonjefir_ = _val_; } // Comment this line
#endif

...

However setting the value of IDL like below is OK and working:

data.bonjefir() = 100; // I don't like it 
data.bonjefir_ = 100;

Is there any solution for this problem?

 

Thanks in advance for your helps.

 

Bonjefir

Share this post


Link to post
Share on other sites

Hi,

 

This is indeed something that appears (only) i.c.w. CX11 compilers and a solution is part of our upcoming V6.6 release (commercially supported edition, scheduled for next month).

We'll also 'cherry-pick' that solution into our community-repository within that same period.

 

Regards,

Hans

Share this post


Link to post
Share on other sites

Dear Hans,

 

Thanks for your answer. Would you please fix this bug as soon as possible you can (before the upcoming release)? I have to change a lot in my codes because of this bug. Also I welcome any other solution.

 

Regards,

Bonjefir

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×