2D array in Inbound messages...

David Yahoo.com david_larbalestier at yahoo.com
Sat Jul 2 03:57:02 UTC 2016


Hi all,

I’ve been lurking in the background of this list for a while now and still unsure if this is the right place for my following question. So, please excuse me if this doesn’t belong here.

I am trying to find a C++ example of using array of arrays in the Inbound messages. The xml input would look something like this…

	<method name="SystemGetDiagnostics">
    		<arg type="a(s)" name="tableNames" direction="out"/>
      		<arg type="a(isssssss)" name="tableHeaders" direction="out"/>
      		<arg type="a(a(sssssss))" name="tableData" direction="out”/>
		<arg type="i" name="status" direction="out"/>
    	</method>

I then use the following to generate the CPP...

"$BASEDIR/scripts/dbusxx-xml2cpp" dbus_recengine_rxp_inbound.xml \
    --adaptor=dbus_recengine_rxp_inbound_adaptor.h --adaptor-template=adaptor-stubs.tpl \
    --templatedir="$BASEDIR/scripts/libdbus-c++”

Which gives me a pure virtual method in dbus_recengine_rxp_inbound_adaptor.h...

	virtual void SystemGetDiagnostics(std::vector< ::DBus::Struct< std::string > >& tableNames, 
		std::vector< ::DBus::Struct< int32_t, std::string, std::string, std::string, std::string, std::string, std::string, std::string > >& tableHeaders, 
		std::vector< ::DBus::Struct< std::vector< ::DBus::Struct< std::string, std::string, std::string, std::string, std::string, std::string, std::string >,  > > >& tableData, 
		int32_t& status, 
		::DBus::Error& error) = 0;

For now I’ve kept my implementation to be empty…

	dbus_recengine_rxp_inbound_server.cpp

	void SystemGetDiagnostics(std::vector< ::DBus::Struct< std::string > >& tableNames, 
		std::vector< ::DBus::Struct< int32_t, std::string, std::string, std::string, std::string, std::string, std::string, std::string > >& tableHeaders, 
		std::vector< ::DBus::Struct< std::vector< ::DBus::Struct< std::string, std::string, std::string, std::string, std::string, std::string, std::string >, > > >& tableData, 			int32_t& status, 
		::DBus::Error& error) {
	}

And I’ve ensured that the header matches…

 	dbus_recengine_rxp_inbound_server.h

	void SystemGetDiagnostics(std::vector< ::DBus::Struct< std::string > >& tableNames, 
		std::vector< ::DBus::Struct< int32_t, std::string, std::string, std::string, std::string, std::string, std::string, std::string > >& tableHeaders, 
		std::vector< ::DBus::Struct< std::vector< ::DBus::Struct< std::string, std::string, std::string, std::string, std::string, std::string, std::string >, > > >& tableData,
		int32_t& status, 
		::DBus::Error& error);

Whenever I try to compile this I get the following error…

dbus_recengine_rxp_inbound_adaptor.h:199:394: error: template argument 2 is invalid
   virtual void SystemGetDiagnostics(std::vector< ::DBus::Struct< std::string > >& tableNames, std::vector< ::DBus::Struct< int32_t, std::string, std::string, std::string, std::string, std::string, std::string, std::string > >& tableHeaders, std::vector< ::DBus::Struct< std::vector< ::DBus::Struct< std::string, std::string, std::string, std::string, std::string, std::string, std::string >,  > > >& tableData, int32_t& status, ::DBus::Error& error) = 0;

So, any suggestions or an example of using array of arrays would be greatly appreciated.

Regards,

David.


More information about the dbus mailing list