[redland-dev] Raptor2: Unnamed struct & Forward Declaration

Christian Waechter waechter at in.tum.de
Thu May 22 15:16:13 EDT 2014


Hello Raptor2-users,

we want to use raptor2 in our C++ library-project and are implementing a 
class that uses raptor2 internally and hides its use to other 
developers/users.

Therefore we decided to use forward declarations to raptor2 structs 
(e.g. raptor_term ) in our headers, such that other developers using our 
library do no necessarily need to point to raptor2 headers as well.
We only use the raptor2 headers in the implementation-files.

No we encountered a problem:
Unfortunately "raptor_term"  is an unnamed struct where a forward 
declaration is not possible, at least to my knowledge.

We see possibilities to use void pointers and reinterpret_casts instead 
of pointers to a raptor_term or maybe a solution similar to the one 
pointed out here: http://stackoverflow.com/a/8833176

Both solutions are not nice and I would like to change this to a more 
safer/clearer version.
Are there any other suggestions or ideas how to deal with this?

And another question regarding the unnamed structs in raptor2: Is there 
any chance that it will be changed to named structs in future releases 
of raptor2? I think this might ease the use of raptor2 in c++ code, at 
least in the described case and as far as I am aware of the possible 
solutions right now.

I am looking forward to any comment or help on this issue.

Best Regards,
Christian Waechter
-- 
Dipl.-Inf. Christian Waechter
Tel: +49 (0)89/289-17089
Fax: +49 (0)89/289-17059
Email: christian.waechter at in.tum.de

Technische Universität München
Fachbereich Informatik
Lehrstuhl Computer Aided Medical
Procedures & Augmented Reality
Boltzmannstr. 3, Raum 00.13.053
D-85748 Garching b. München


More information about the redland-dev mailing list