prefix_ void senf::ppi::connector::Connector::connect(Connector & target)
{
// The connector is not registered -> route() or noroute() statement missing
- SENF_ASSERT( module_ );
+ SENF_ASSERT( module_ &&
+ "senf::ppi::connector::Connector::connect(): (source) "
+ "Missing route() or noroute()" );
// The connector is already connected
- SENF_ASSERT( ! peer_ );
+ SENF_ASSERT( ! peer_ &&
+ "senf::ppi::connector::Connector::connect(): (source) "
+ "duplicate connection" );
// The target connector is not registered -> route() or noroute() statement missing
- SENF_ASSERT( target.module_ );
+ SENF_ASSERT( target.module_ &&
+ "senf::ppi::connector::Connector::connect(): (target) "
+ "Missing route() or noroute()" );
// The target connector is already connected
- SENF_ASSERT( ! target.peer_ );
+ SENF_ASSERT( ! target.peer_ &&
+ "senf::ppi::connector::Connector::connect(): (target) "
+ "duplicate connection" );
if (! (packetTypeID() == typeid(void) ||
target.packetTypeID() == typeid(void) ||
packetTypeID() == target.packetTypeID()) )
prefix_ void senf::ppi::connector::Connector::disconnect()
{
// Cannot disconnected a non-connected connector
- SENF_ASSERT( peer_ );
+ SENF_ASSERT( peer_ &&
+ "senf::ppi::connector::Connector::disconnect(): Not connected" );
Connector & peer (*peer_);
peer_ = 0;
peer.peer_ = 0;
const
{
// The connector is not connected
- SENF_ASSERT(peer_);
+ SENF_ASSERT(peer_ && "senf::ppi::connect() call missing");
return *peer_;
}
{
// The connector is not registered in the module -> probably a route() or noroute() statement is
// missing.
- SENF_ASSERT(module_);
+ SENF_ASSERT(module_ && "Connector not registered: Missing route() or noroute()");
return *module_;
}
prefix_ void senf::ppi::connector::PassiveConnector::emit()
{
- // No event callback has been registered (onEvent() call missing)
- SENF_ASSERT(callback_);
+ // No event callback has been registered (onRequest() call missing)
+ SENF_ASSERT(callback_ && "senf::ppi::connector::PassiveConnector: missing onRequest()");
if (!throttled())
callback_();
}
const
{
// Cannot peek() head of empty queue
- SENF_ASSERT( ! queue_.empty() );
+ SENF_ASSERT( ! queue_.empty() &&
+ "senf::ppi::connector::InputConnector: cannot call peek() on empty queue" );
return queue_.back();
}
prefix_ void senf::ppi::module::debug::PassiveSource::request()
{
- SENF_ASSERT( ! packets_.empty() );
+ SENF_ASSERT( ! packets_.empty() &&
+ "senf::ppi::module::debug::PassiveSource::request(): "
+ "Requesting packet from empty source." );
output(packets_.front());
packets_.pop_front();
if (packets_.empty())
prefix_ senf::ppi::detail::EventBinding<EventType> &
senf::ppi::EventImplementationHelper<EventType,Self>::binding()
{
- SENF_ASSERT( static_cast<Self*>(this)->binding_ );
+ SENF_ASSERT( static_cast<Self*>(this)->binding_ &&
+ "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
return * static_cast<Self*>(this)->binding_;
}
prefix_ senf::ppi::detail::EventBinding<void> &
senf::ppi::EventImplementationHelper<void,Self>::binding()
{
- SENF_ASSERT( static_cast<Self*>(this)->binding_ );
+ SENF_ASSERT( static_cast<Self*>(this)->binding_ &&
+ "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
return * static_cast<Self*>(this)->binding_;
}
else if (event & Hup)
throw HangupException();
else
- // This cannot happen.
- SENF_ASSERT(false);
+ SENF_ASSERT(false && "Internal failure in senf::ppi::IOEvent::cb(int)");
} else {
IOEventInfo info = { event };
callback(info);
prefix_ bool senf::intrusive_refcount_base::release()
{
- SENF_ASSERT(refcount_>0);
+ SENF_ASSERT(refcount_>0 &&
+ "senf::intrusive_refcount_base: Internal inconsistency: "
+ "Calling release on dead object.");
return --refcount_ == 0;
}
{
// When deriving from Self you may not change the class's size without
// inheriting from pool_alloc_mixin again. See pool_alloc_mixin documentation.
- SENF_ASSERT( size <= sizeof(Self) );
+ SENF_ASSERT( size <= sizeof(Self) &&
+ "senf::pool_alloc_mixin::operator new(): "
+ "Bad object size. Missing pool_alloc_mixin base in derived class?" );
#ifdef SENF_DEBUG
allocCounter(1);
#endif