Fix Boost.Python not getting the right signature
This commit is contained in:
parent
d56c17a166
commit
91aa984350
|
@ -15,7 +15,7 @@ namespace client {
|
||||||
|
|
||||||
class Actor
|
class Actor
|
||||||
: public EnableSharedFromThis<Actor>,
|
: public EnableSharedFromThis<Actor>,
|
||||||
private detail::ActorState {
|
public detail::ActorState {
|
||||||
using Super = detail::ActorState;
|
using Super = detail::ActorState;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -23,10 +23,6 @@ namespace client {
|
||||||
|
|
||||||
virtual ~Actor() = default;
|
virtual ~Actor() = default;
|
||||||
|
|
||||||
using Super::GetId;
|
|
||||||
using Super::GetTypeId;
|
|
||||||
using Super::GetDisplayId;
|
|
||||||
using Super::GetWorld;
|
|
||||||
|
|
||||||
geom::Location GetLocation() const;
|
geom::Location GetLocation() const;
|
||||||
|
|
||||||
|
@ -48,8 +44,6 @@ namespace client {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
using Super::GetActorDescription;
|
|
||||||
|
|
||||||
auto GetClientImplementation() const {
|
auto GetClientImplementation() const {
|
||||||
return GetWorld().parent;
|
return GetWorld().parent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,14 +29,16 @@ namespace detail {
|
||||||
|
|
||||||
std::string GetDisplayId() const;
|
std::string GetDisplayId() const;
|
||||||
|
|
||||||
const rpc::Actor &GetActorDescription() const {
|
|
||||||
return _description;
|
|
||||||
}
|
|
||||||
|
|
||||||
World GetWorld() const {
|
World GetWorld() const {
|
||||||
return _parent;
|
return _parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
const rpc::Actor &GetActorDescription() const {
|
||||||
|
return _description;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ActorState(rpc::Actor description, World parent)
|
ActorState(rpc::Actor description, World parent)
|
||||||
|
|
|
@ -27,10 +27,11 @@ void export_actor() {
|
||||||
namespace cr = carla::rpc;
|
namespace cr = carla::rpc;
|
||||||
|
|
||||||
class_<cc::Actor, boost::noncopyable, boost::shared_ptr<cc::Actor>>("Actor", no_init)
|
class_<cc::Actor, boost::noncopyable, boost::shared_ptr<cc::Actor>>("Actor", no_init)
|
||||||
.add_property("id", &cc::Actor::GetId)
|
// work-around, force return copy to resolve Actor instead of ActorState.
|
||||||
.add_property("type_id", +[](const cc::Actor &self) -> std::string { return self.GetTypeId(); })
|
.add_property("id", CALL_RETURNING_COPY(cc::Actor, GetId))
|
||||||
.add_property("is_alive", &cc::Actor::IsAlive)
|
.add_property("type_id", CALL_RETURNING_COPY(cc::Actor, GetTypeId))
|
||||||
.def("get_world", &cc::Actor::GetWorld)
|
.add_property("is_alive", CALL_RETURNING_COPY(cc::Actor, IsAlive))
|
||||||
|
.def("get_world", CALL_RETURNING_COPY(cc::Actor, GetWorld))
|
||||||
.def("get_location", CONST_CALL_WITHOUT_GIL(cc::Actor, GetLocation))
|
.def("get_location", CONST_CALL_WITHOUT_GIL(cc::Actor, GetLocation))
|
||||||
.def("get_transform", CONST_CALL_WITHOUT_GIL(cc::Actor, GetTransform))
|
.def("get_transform", CONST_CALL_WITHOUT_GIL(cc::Actor, GetTransform))
|
||||||
.def("set_location", &cc::Actor::SetLocation, (arg("location")))
|
.def("set_location", &cc::Actor::SetLocation, (arg("location")))
|
||||||
|
|
Loading…
Reference in New Issue