[Rock-dev] typelib and std::vector

Alexander Duda Alexander.Duda at dfki.de
Wed Jan 26 19:16:36 CET 2011


Hi 

how does typelib handle std::vectors when they are accessed from ruby?
Are the following assumptions right?

for std::vector<uint8_t> or similar:
my_vector.to_a ---> copies the vector into a ruby array
my_vector[i] --> not defined 
my_vector.each do |v| -->iterates over all fields without copying them
my_vector.push s --> pushes the sample to the back of the vector
--> How can I access a specific index without converting it to a ruby
array?

for std::vector<CompoundType>
my_vector is converted automatically to a ruby array


thx

Alex


-- 
Dipl.-Ing. Alexander Duda 
Unterwasserrobotik

DFKI Bremen
Robotics Innovation Center
Robert-Hooke-Straße 5
28359 Bremen, Germany

Phone: +49 (0)421 178-456620
Fax:   +49 (0)421 178-454150
E-Mail: alexander.duda at dfki.de

Weitere Informationen: http://www.dfki.de/robotik
-----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
(Vorsitzender) Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313
Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
USt-Id.Nr.:    DE 148646973
Steuernummer:  19/673/0060/3



More information about the Rock-dev mailing list