Node<>::getAllocator() preserves full allocator type

This commit is contained in:
Pavel Kirienko
2014-04-11 19:23:05 +04:00
parent 6435c82d06
commit bba89bdd3d
+5 -3
View File
@@ -36,7 +36,9 @@ class UAVCAN_EXPORT Node : public INode
MemPoolSize = (MemPoolSize_ < std::size_t(MemPoolBlockSize)) ? std::size_t(MemPoolBlockSize) : MemPoolSize_
};
PoolAllocator<MemPoolSize, MemPoolBlockSize> pool_allocator_;
typedef PoolAllocator<MemPoolSize, MemPoolBlockSize> Allocator;
Allocator pool_allocator_;
MarshalBufferProvider<OutgoingTransferMaxPayloadLen> marsh_buf_;
OutgoingTransferRegistry<OutgoingTransferRegistryStaticEntries> outgoing_trans_reg_;
Scheduler scheduler_;
@@ -58,8 +60,6 @@ protected:
(void)getLogger().log(protocol::debug::LogLevel::ERROR, "UAVCAN", msg);
}
virtual IAllocator& getAllocator() { return pool_allocator_; }
virtual IMarshalBufferProvider& getMarshalBufferProvider() { return marsh_buf_; }
public:
@@ -74,6 +74,8 @@ public:
, started_(false)
{ }
virtual Allocator& getAllocator() { return pool_allocator_; }
virtual Scheduler& getScheduler() { return scheduler_; }
virtual const Scheduler& getScheduler() const { return scheduler_; }