[GCC-XML] gccxml and boost.shared_ptr

Alexis H. Rivera-Rios ahrivera at yahoo.com
Thu Jul 28 13:32:32 EDT 2005

can somebody explain me this error?  Here is the code.
 It compiles fine in VC71/Boost 1.32

class Entity
		/// type of trajectory pointer
		typedef boost::shared_ptr<StatATA::Trajectory>
		/// constructor
		Entity() : trajectory(), state() {}
		/// destructor
		virtual ~Entity() {}
		/// sets the position
		void SetPosition(const gmtl::Point3d &pos)
			state.position = pos; 
		/// returns the position
		gmtl::Point3d GetPosition() const { return
state.position; }
		/// sets the velocity
		void SetVelocity(const gmtl::Vec3d& vel)
			state.velocity = vel;
		/// returns the velocity
		gmtl::Vec3d GetVelocity() const { return
state.velocity; }

		/// sets the acceleration
		void SetAcceleration(const gmtl::Vec3d& acc)
			state.acceleration = acc;
		/// returns the acceleration
		gmtl::Vec3d GetAcceleration() const { return
state.acceleration; }
		/// set the heading (unit vector)
		void SetHeading(const gmtl::Vec3d& hed)
			state.heading = hed;
		/// returns the heading of the missile (unit vector)
		gmtl::Vec3d GetHeading() const { return
state.heading; }

		/// sets the trajectory strategy
		void SetTrajectory(const TrajectoryPtr&
			trajectory = newTrajectory;
		/// delegates to the Trajectory object 
		/// the updating of the missile state
		virtual void UpdateState(double ellapsedTime=1)
			if (trajectory.get())
				//Trajectory *t = trajectory.get();

		/// reset the state to a default value
		virtual void ResetState()
			state = EntityState();
		EntityState state; ///< entity's physical state
		TrajectoryPtr trajectory; ///< algorithm for
updating the missle state
		/// copy constructor disabled
		Entity(const Entity& );
		/// assignment disabled
		Entity& operator=(const Entity &);


But when I run Pyste (which calls gccxml) it

C:/Boost/include/boost-1_32/boost/shared_ptr.hpp: In
member function `T*
   boost::shared_ptr<T>::operator->() const [with T =
../StatATA/entity.h:78:   instantiated from here
error: invalid conversion

   from `void*' to `const char*'
../StatATA/entity.h: In member function `virtual void
../StatATA/entity.h:78: error: `ellapseTime'
undeclared (first use this
../StatATA/entity.h:78: error: (Each undeclared
identifier is reported only
   once for each function it appears in.)

But if I do:

Trajectory *t = trajectory.get();

instead of:			

it works... but that sucks.  

Any comments would be greatly appreciated.


Programming Tutorial:
In Python: To do this, do this
In Perl: To do this, do this or this or this or this...
In C: To do this, do this, but be careful
In C++: To do this, do this, but don't do this, be careful of this, watch out for this, and whatever you do, don't do this

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

More information about the gccxml mailing list