NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
signal-emit.hpp File Reference

Copyright (c) 2013-2014 Regents of the University of California. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ndn::util::signal::DummyExtraArg
 (implementation detail) a filler for extra argument More...
 

Namespaces

 ndn
 Copyright (c) 2011-2015 Regents of the University of California.
 
 ndn::util
 
 ndn::util::signal
 

Macros

#define DECLARE_SIGNAL_EMIT(signalName)
 (implementation detail) declares a 'emit_signalName' method More...
 
#define NDN_CXX_SIGNAL_EMIT(signalName, ...)   emit_##signalName(__VA_ARGS__)
 (implementation detail) invokes emit_signalName method More...
 
#define emitSignal(...)   NDN_CXX_SIGNAL_EMIT(__VA_ARGS__, ::ndn::util::signal::DummyExtraArg())
 (implementation detail) More...
 

Detailed Description

Copyright (c) 2013-2014 Regents of the University of California.

This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).

ndn-cxx library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received copies of the GNU General Public License and GNU Lesser General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see http://www.gnu.org/licenses/.

See AUTHORS.md for complete list of ndn-cxx authors and contributors.

This header provides macros that allows a signal to be emitted from a derived class of its owner.

In 'protected' section of owner class declaration, DECLARE_SIGNAL_EMIT(signalName) From a derived class of owner, this->emitSignal(signalName, arg1, arg2);

Definition in file signal-emit.hpp.

Macro Definition Documentation

◆ DECLARE_SIGNAL_EMIT

#define DECLARE_SIGNAL_EMIT (   signalName)
Value:
template<typename ...TArgs> \
void emit_##signalName(const TArgs&... args) \
{ \
signalName(args...); \
}

(implementation detail) declares a 'emit_signalName' method

Note
This macro should be used in 'protected' section so that it's accessible by derived classes.
emit_signalName method is implementation detail. Derived classes should use 'emitSignal' macro.
The name 'emit_signalName' is an intentional violation of code-style rule 2.5.
The method is declared as a template, so that the macro doesn't need argument types. But only argument types that are compatible with Signal declaration will work.

Definition at line 59 of file signal-emit.hpp.

◆ NDN_CXX_SIGNAL_EMIT

#define NDN_CXX_SIGNAL_EMIT (   signalName,
  ... 
)    emit_##signalName(__VA_ARGS__)

(implementation detail) invokes emit_signalName method

Note
C99 requires at least one argument to be passed in VA_ARGS, thus a DummyExtraArg is expected at the end of VA_ARGS, which will be accepted but ignored by Signal::operator() overload.

Definition at line 71 of file signal-emit.hpp.

◆ emitSignal