DebugUtils.h File Reference

#include <cstdio>
#include <cstdlib>
#include "FatalSignals.h"
#include "../memory/Memory.h"

Go to the source code of this file.

Namespaces

namespace  oasys

Classes

struct  static_assert_test< x >
 Compile time static checking (better version, from Boost) Take the sizeof() of an undefined template, which will die. More...
struct  STATIC_ASSERTION_FAILURE< true >
class  oasys::Breaker

Defines

#define ASSERT(x)
#define NOTREACHED
#define NOTIMPLEMENTED
#define delete_z(_obj)   do { delete _obj; _obj = 0; } while (0)
#define STATIC_ASSERT(_x, _what)
#define NO_COPY(_Classname)   private: _Classname(const _Classname& other)
#define NO_ASSIGN(_Classname)   private: _Classname& operator=(const _Classname& other)
#define NO_ASSIGN_COPY(_Classname)


Define Documentation

#define ASSERT (  ) 

Value:

do { if (! (x)) {                                                   \
        fprintf(stderr, "ASSERTION FAILED (" #x ") at %s:%d\n",         \
                __FILE__, __LINE__);                                    \
        ::oasys::Breaker::break_here();                                 \
        ::oasys::FatalSignals::die();                                   \
    } } while(0);

Definition at line 47 of file DebugUtils.h.

Referenced by dtn::TCPConvergenceLayer::Connection::accept(), oasys::BluetoothServer::accept(), dtn::BluetoothConvergenceLayer::Connection::accept(), dtn::BluetoothConvergenceLayer::Listener::accepted(), oasys::BerkeleyDBStore::acquire_table(), dtn::BundleList::add_bundle(), oasys::InitSequencer::add_extra_deps(), oasys::RefCountedObject::add_ref(), dtn::Bundle::add_ref(), oasys::InitSequencer::add_step(), dtn::BluetoothConvergenceLayer::ConnectionManager::addListener(), oasys::IO::adjust_timeout(), dtn::Prophet::age(), oasys::StringBuffer::append(), dtn::BundlePayload::append_data(), oasys::StringBuffer::append_int(), oasys::IPSocket::async_connect_result(), oasys::BluetoothSocket::async_connect_result(), oasys::ExpandableBuffer::at(), dtn::BluetoothConvergenceLayer::Connection::break_contact(), dtn::BundleActions::cancel_bundle(), oasys::ExpatXMLParser::character_data(), dtn::StreamConvergenceLayer::Connection::check_completed(), dtn::FragmentManager::check_completed(), dtnsim::SimContact::chew_message(), dtn::Registration::cleanup_expiration_timer(), oasys::OnOffNotifier::clear(), dtn::Link::close(), oasys::IPSocket::close(), oasys::BluetoothSocket::close(), dtnsim::SimContact::close_contact(), dtn::ConnectionConvergenceLayer::close_contact(), dtn::CLConnection::close_contact(), dtn::BundleActions::close_link(), oasys::BluetoothSocket::configure(), dtn::TCPConvergenceLayer::Connection::connect(), dtn::BluetoothConvergenceLayer::Connection::connect(), dtn::BluetoothConvergenceLayer::ConnectionManager::connection(), oasys::StreamBuffer::consume(), oasys::COWIoVec::consume(), dtn::CLConnection::contact_up(), dtn::BundleList::contains(), dtn::FragmentManager::convert_to_fragment(), oasys::COWIoVec::copy(), dtn::EndpointID::copyto(), dtnsim::Connectivity::create_conn(), dtn::CustodySignal::create_custody_signal(), dtn::Link::create_link(), dtn::BundleStatusReport::create_status_report(), oasys::DurableStore::create_store(), dtn::BundleList::del_bundle(), dtn::BluetoothConvergenceLayer::ConnectionManager::del_listener(), oasys::RefCountedObject::del_ref(), oasys::FileSystemStore::del_table(), oasys::BerkeleyDBStore::del_table(), dtn::Prophet::delivery_predictability(), dtn::BluetoothConvergenceLayer::ConnectionManager::delListener(), oasys::Log::do_init(), oasys::ScopeLockIf::do_lock(), oasys::ScopeLock::do_lock(), dtn::TCPConvergenceLayer::dump_interface(), dtn::TCPConvergenceLayer::dump_link(), dtn::StreamConvergenceLayer::dump_link(), dtn::ConnectionConvergenceLayer::dump_link(), oasys::Log::dump_rules(), dtn::SDNV::encode(), dtn::SDNV::encoding_len(), oasys::ExpandableBuffer::end(), oasys::ExpatXMLParser::end_element(), oasys::OpenFdCache< _Key, _CloseFcn >::evict(), dtn::TestCommand::exec(), dtnsim::Simdtn2Command::exec(), dtn::RegistrationCommand::exec(), oasys::SMTPUtils::extract_address(), dtn::Prophet::favorability(), oasys::FileSystemIterator::FileSystemIterator(), oasys::StreamBuffer::fill(), dtn::ContactManager::find_link_to(), oasys::Log::find_rule(), dtn::LinkStateGraph::findNextHop(), dtn::StreamConvergenceLayer::Connection::finish_bundle(), dtn::StreamConvergenceLayer::finish_init_link(), dtn::FloodBundleRouter::FloodBundleRouter(), dtn::Registration::force_expire(), dtn::BundleProtocol::format_header_blocks(), dtnsim::GlueNode::forward_event(), oasys::BerkeleyDBTable::get(), oasys::OpenFdCache< _Key, _CloseFcn >::get_and_pin(), oasys::BufferedInput::get_char(), oasys::FileSystemTable::get_common(), dtn::BundleTimestamp::get_current_time(), oasys::MemoryIterator::get_key(), oasys::FileSystemIterator::get_key(), oasys::BerkeleyDBIterator::get_key(), oasys::Regex::get_match(), oasys::BerkeleyDBStore::get_meta_table(), oasys::IO::get_nonblocking(), oasys::TextUnmarshal::get_num(), oasys::InitSequencer::get_step(), oasys::FileSystemStore::get_table(), oasys::DurableStore::get_table(), oasys::BerkeleyDBStore::get_table(), oasys::TextUnmarshal::get_textcode(), oasys::gethostbyname(), dtn::CLConnection::handle_announce_bundle(), dtntunnel::TCPTunnel::handle_bundle(), dtntunnel::DTNTunnel::handle_bundle(), dtn::BundleDaemon::handle_bundle_expired(), dtn::BundleDaemon::handle_bundle_free(), dtn::LinkStateRouter::handle_bundle_received(), dtn::BundleDaemon::handle_bundle_transmitted(), dtn::StreamConvergenceLayer::Connection::handle_contact_initiation(), dtn::BundleDaemon::handle_contact_up(), dtn::BundleDaemon::handle_custody_timeout(), dtn::StreamConvergenceLayer::Connection::handle_data_todo(), dtn::BundleDaemon::handle_link_available(), dtn::ProphetRouter::handle_link_created(), dtn::FloodBundleRouter::handle_link_created(), dtn::BundleDaemon::handle_link_state_change_request(), dtn::BundleDaemon::handle_link_unavailable(), dtn::StreamConvergenceLayer::Connection::handle_poll_timeout(), dtn::APIClient::handle_recv(), dtn::APIClient::handle_unbind(), dtn::APIClient::handle_unregister(), oasys::ExpandableBuffer::incr_len(), oasys::TimerThread::init(), dtn::DTNServer::init(), dtnsim::SimConvergenceLayer::init_link(), oasys::BluetoothSocket::init_sa(), oasys::IPSocket::init_socket(), oasys::BluetoothSocket::init_socket(), dtn::TCPConvergenceLayer::Connection::initialize_pollfds(), dtn::StreamConvergenceLayer::Connection::initiate_contact(), oasys::TclCommandInterp::instance(), oasys::Singleton< _Class, false >::instance(), oasys::Singleton< _Class, true >::instance(), dtnsim::Connectivity::instance(), dtn::TCPConvergenceLayer::interface_down(), oasys::BufferedInput::internal_read(), dtn::BundlePayload::internal_write(), oasys::IOHandlerBase::interrupt_from_io(), oasys::Thread::join(), dtn::Link::Link(), oasys::TCPServer::listen(), oasys::BluetoothServer::listen(), dtn::BluetoothConvergenceLayer::Listener::Listener(), dtn::BluetoothConvergenceLayer::ConnectionManager::listener(), dtn::GlobalStore::load(), oasys::SpinLock::lock(), oasys::Log::log_multiline(), oasys::PermutationArray::map(), oasys::InitSequencer::mark_dep(), dtn::WildcardScheme::match(), dtn::TCAScheme::match(), dtn::StringScheme::match(), dtn::DTNScheme::match(), dtn::BundlePayload::memory_data(), dtn::BluetoothConvergenceLayer::NeighborDiscovery::NeighborDiscovery(), dtn::TCPConvergenceLayer::new_connection(), oasys::TypeCollectionInstance< _Collection >::new_object(), oasys::BluetoothInquiry::next(), oasys::BerkeleyDBIterator::next(), dtn::GlobalStore::next_bundleid(), dtn::GlobalStore::next_regid(), oasys::ExpandableBuffer::nfree(), oasys::Notifier::notify(), dtn::Link::open(), dtn::UDPConvergenceLayer::open_contact(), dtn::ConnectionConvergenceLayer::open_contact(), dtn::BluetoothConvergenceLayer::open_contact(), oasys::Ref< _Type >::operator *(), oasys::Ref< _Type >::operator->(), dtn::LinkStateGraph::Vertex::operator<(), oasys::ScopeMalloc::operator=(), oasys::ScopePtr< _Class >::operator=(), oasys::Log::parse_debug_file(), dtn::BundleProtocol::parse_header_blocks(), oasys::URL::parse_internal(), dtn::TCPConvergenceLayer::parse_link_params(), dtn::StreamConvergenceLayer::parse_link_params(), dtn::TCPConvergenceLayer::parse_nexthop(), oasys::IO::poll_multiple(), oasys::IO::poll_with_notifier(), dtn::BlockingBundleList::pop_blocking(), dtn::BundleList::pop_front(), oasys::TimerSystem::pop_timer(), dtn::BundleDaemon::post_and_wait(), dtn::FragmentManager::proactively_fragment(), oasys::TextUnmarshal::process(), oasys::TclListSerialize::process(), dtnsim::SimContact::process(), oasys::Unmarshal::process(), oasys::KeyUnmarshal::process(), oasys::KeyMarshal::process(), oasys::SMTP::process_cmd(), dtn::CLConnection::process_command(), dtn::StreamConvergenceLayer::Connection::process_data(), dtn::FragmentManager::process_for_reassembly(), oasys::KeyMarshal::process_int(), oasys::BluetoothSocket::prototoa(), oasys::FileSystemTable::put(), oasys::OpenFdCache< _Key, _CloseFcn >::put_and_pin(), oasys::ExpandableBuffer::raw_buf(), oasys::RFCOMMClient::rc_connect(), oasys::BufferedInput::read_bytes(), dtn::BundlePayload::read_data(), oasys::BufferedInput::read_some_bytes(), oasys::StreamBuffer::realloc(), dtn::ConnectionConvergenceLayer::reconfigure_link(), dtn::BluetoothConvergenceLayer::Connection::recv_announce(), dtn::BluetoothConvergenceLayer::Connection::recv_bundle(), dtn::BluetoothConvergenceLayer::Connection::recv_contact_header(), dtn::TCPConvergenceLayer::Connection::recv_data(), dtn::BluetoothConvergenceLayer::Connection::recv_loop(), oasys::Log::redirect_stdio(), oasys::TypeCollection::reg(), oasys::BerkeleyDBStore::release_table(), dtn::LinkStateGraph::removeEdge(), oasys::FileIOClient::reopen(), oasys::ScratchBuffer< u_char * >::reserve(), oasys::PointerHandle< _PtrType >::restore_and_update(), oasys::FileUtils::rm_all_from_dir(), dtn::BundleDaemon::router(), dtntunnel::TCPTunnel::Connection::run(), dtnsim::Simulator::run(), dtn::BundleDaemon::run(), oasys::BluetoothServerThread::run(), dtn::BluetoothConvergenceLayer::Connection::run(), oasys::TimerSystem::run_expired_timers(), oasys::InitSequencer::run_steps(), oasys::IO::rwdata(), oasys::IO::rwvall(), oasys::BluetoothSocket::sa_baddr(), oasys::BluetoothSocket::sa_channel(), oasys::RateLimitedSocket::send(), dtn::BluetoothConvergenceLayer::Connection::send_announce(), dtn::UDPConvergenceLayer::send_bundle(), dtnsim::SimConvergenceLayer::send_bundle(), dtn::ConnectionConvergenceLayer::send_bundle(), dtn::BundleActions::send_bundle(), dtn::BluetoothConvergenceLayer::Connection::send_bundle(), dtn::BluetoothConvergenceLayer::send_bundle(), dtn::TCPConvergenceLayer::Connection::send_data(), dtn::StreamConvergenceLayer::Connection::send_data_todo(), dtn::StreamConvergenceLayer::Connection::send_keepalive(), dtn::BluetoothConvergenceLayer::Connection::send_loop(), dtn::StreamConvergenceLayer::Connection::send_next_segment(), dtn::StreamConvergenceLayer::Connection::send_pending_acks(), dtn::StreamConvergenceLayer::Connection::send_pending_data(), dtn::APIClient::send_response(), oasys::RateLimitedSocket::sendto(), dtn::Link::serialize(), dtn::EndpointID::serialize(), oasys::BluetoothSocket::set_channel(), dtn::Link::set_cl_info(), dtn::Interface::set_cl_info(), dtn::Contact::set_cl_info(), dtn::Link::set_contact(), dtn::BundlePayload::set_data(), oasys::Thread::set_interruptable(), oasys::ExpandableBuffer::set_len(), oasys::StringBuffer::set_length(), dtn::BundlePayload::set_length(), oasys::BluetoothInquiry::set_length(), oasys::IOHandlerBase::set_notifier(), oasys::BluetoothInquiry::set_numresponses(), oasys::PointerCache< _Name, _PtrType >::set_ptr(), oasys::XMLDocument::set_root(), oasys::StreamBuffer::set_size(), dtn::TableBasedRouter::should_fwd(), oasys::IPSocket::shutdown(), oasys::BluetoothSocket::shutdown(), oasys::OnOffNotifier::signal(), dtnsim::SimContact::SimContact(), oasys::FileSystemTable::size(), oasys::BerkeleyDBTable::size(), oasys::SMTP::SMTP(), oasys::BasicSMTPHandler::smtp_DATA_begin(), oasys::Log::sort_rules(), oasys::Thread::start(), oasys::ExpatXMLParser::start_element(), dtn::StreamConvergenceLayer::Connection::start_next_bundle(), oasys::IPSocket::statetoa(), oasys::BluetoothSocket::statetoa(), dtn::StreamConvergenceLayer::Connection::stream_lparams(), oasys::StreamBuffer::StreamBuffer(), oasys::StringBuffer::StringBuffer(), oasys::ExpandableBuffer::tail_buf(), dtn::TCPConvergenceLayer::Connection::tcp_lparams(), oasys::TCPClient::TCPClient(), oasys::Thread::Thread(), oasys::FileSystemStore::tidy_database(), oasys::TCPServer::timeout_accept(), oasys::BluetoothServer::timeout_accept(), oasys::TCPClient::timeout_connect(), dtn::Prophet::transitivity(), oasys::StringBuffer::trim(), dtn::BundlePayload::truncate(), oasys::SpinLock::try_lock(), oasys::TextMarshal::unindent(), oasys::SpinLock::unlock(), oasys::Mutex::unlock(), oasys::OpenFdCache< _Key, _CloseFcn >::unpin(), dtn::GlobalStore::update(), oasys::StringBuffer::vappendf(), oasys::BufferedOutput::vformat_buf(), oasys::Log::vlogf(), dtn::APIClient::wait_for_bundle(), dtn::BundlePayload::write_data(), dtn::Bundle::~Bundle(), dtn::Contact::~Contact(), dtn::Link::~Link(), and oasys::Lock::~Lock().

#define delete_z ( _obj   )     do { delete _obj; _obj = 0; } while (0)

Make sure to null out after deleting an object. USE THIS.

Definition at line 146 of file DebugUtils.h.

Referenced by dtn::DTNServer::close_datastore(), oasys::BerkeleyDBStore::get_table_names(), dtn::APIClient::~APIClient(), oasys::IOHandlerBase::~IOHandlerBase(), and oasys::StringBuffer::~StringBuffer().

#define NO_ASSIGN ( _Classname   )     private: _Classname& operator=(const _Classname& other)

Macros to define but not declare copy and assignment operator to avoid accidently usage of such constructs. Put this at the top of the class declaration.

Definition at line 157 of file DebugUtils.h.

#define NO_ASSIGN_COPY ( _Classname   ) 

Value:

NO_COPY(_Classname);                         \
   NO_ASSIGN(_Classname)
Macros to define but not declare copy and assignment operator to avoid accidently usage of such constructs. Put this at the top of the class declaration.

Definition at line 160 of file DebugUtils.h.

#define NO_COPY ( _Classname   )     private: _Classname(const _Classname& other)

Macros to define but not declare copy and assignment operator to avoid accidently usage of such constructs. Put this at the top of the class declaration.

Definition at line 154 of file DebugUtils.h.

#define NOTIMPLEMENTED

Value:

do {                                                                \
        fprintf(stderr, "%s NOT IMPLEMENTED at %s:%d\n",                \
                __FUNCTION__, __FILE__, __LINE__);                      \
        ::oasys::Breaker::break_here();                                 \
        ::oasys::FatalSignals::die();                                   \
    } while(0);

Definition at line 105 of file DebugUtils.h.

Referenced by dtn::ScheduledLink::convert_fc(), oasys::BerkeleyDBStore::get_table_names(), dtn::BundleList::insert_sorted(), dtn::FileConvergenceLayer::interface_up(), oasys::Thread::interrupt(), oasys::Thread::kill(), oasys::TextUnmarshal::process(), oasys::SQLExtract::process(), oasys::SQLTableFormat::process(), oasys::SQLUpdate::process(), oasys::SQLInsert::process(), dtnsim::Simulator::process(), dtn::FileConvergenceLayer::send_bundle(), oasys::Thread::set_interruptable(), and dtn::BundleRouter::~BundleRouter().

#define NOTREACHED

Value:

do {                                                                \
        fprintf(stderr, "NOTREACHED REACHED at %s:%d\n",                \
                __FILE__, __LINE__);                                    \
        ::oasys::Breaker::break_here();                                 \
        ::oasys::FatalSignals::die();                                   \
    } while(0);

Definition at line 97 of file DebugUtils.h.

Referenced by dtn::ForwardingInfo::action_to_str(), dtn::FragmentManager::check_completed(), dtn::TestCommand::exec(), dtn::BundleProtocol::get_admin_type(), dtn::BundleDaemon::handle_bundle_received(), oasys::IO::ioerr2str(), dtn::DTND::main(), oasys::Mutex::Mutex(), oasys::IO::poll_with_notifier(), dtn::ContactEvent::reason_to_str(), oasys::TimerThread::run(), oasys::InitConfigStep::run_component(), oasys::IO::rwdata(), dtn::Link::set_state(), dtnsim::sim_ev2str(), dtn::Link::state_to_str(), dtn::ForwardingInfo::state_to_str(), oasys::Thread::thread_run(), dtn::InterfaceTable::~InterfaceTable(), and dtn::RegistrationTable::~RegistrationTable().

#define STATIC_ASSERT ( _x,
_what   ) 

Value:

typedef static_assert_test                     \
    <                                              \
        sizeof(STATIC_ASSERTION_FAILURE<(bool)(_x)>) \
    > static_assert_typedef_ ## _what;

Definition at line 125 of file DebugUtils.h.


Generated on Fri Dec 22 14:48:01 2006 for DTN Reference Implementation by  doxygen 1.5.1