struct DuplicateKeyException : public senf::Exception
{ DuplicateKeyException(AnnotationType const & key)
- : senf::Exception("Duplicate senf::ppi::module::AnnotationRouter routing key")
+ : senf::Exception("Duplicate senf::ppi::module::AnnotationRouter routing key ")
{ append(boost::lexical_cast<std::string>(key)); } };
private:
impl().clear(this);
}
+prefix_ void senf::PacketData::reserve(size_type n)
+{
+ impl().reserve(n + size() - impl().size());
+}
+
+prefix_ senf::PacketData::size_type senf::PacketData::capacity()
+ const
+{
+ return impl().capacity() - (impl().size() - size());
+}
+
prefix_ bool senf::PacketData::valid()
{
return impl_;
void resize(size_type n, byte v=0);
+ void reserve(size_type n);
+ size_type capacity() const;
+
///@}
protected:
updateIterators(self,ix,-delta);
}
+prefix_ void senf::detail::PacketImpl::reserve(size_type n)
+{
+ data_.reserve(n);
+}
+
+prefix_ senf::detail::PacketImpl::size_type senf::detail::PacketImpl::capacity()
+ const
+{
+ return data_.capacity();
+}
+
///////////////////////////////////////////////////////////////////////////
// senf::detail::PacketImpl::Guard
void erase(PacketData * self, iterator first, iterator last);
void clear(PacketData * self);
+ void reserve(size_type n);
+ size_type capacity() const;
+
// Annotations
template <class Annotation>
Annotation & annotation();
return argc_;
}
-prefix_ char ** senf::Daemon::argv()
+prefix_ char const ** senf::Daemon::argv()
{
return argv_;
}
prefix_ void senf::Daemon::removeDaemonArgs()
{
- char ** last (std::remove_if(argv_+1, argv_+argc_, IsDaemonOpt()));
+ char const ** last (std::remove_if(argv_+1, argv_+argc_, IsDaemonOpt()));
*last = 0;
argc_ = last - argv_;
}
throw DaemonExitException(code);
}
-prefix_ int senf::Daemon::start(int argc, char ** argv)
+prefix_ int senf::Daemon::start(int argc, char const ** argv)
{
argc_ = argc;
argv_ = argv;
successful startup. */
int argc(); ///< Access command line parameter count
- char ** argv(); ///< Access command line parameters
+ char const ** argv(); ///< Access command line parameters
void removeDaemonArgs(); ///< Remove the daemon arguments from argc()/argv()
static void exit(unsigned code=0); ///< Terminate daemon with failure
///\}
- int start(int argc, char ** argv); ///< Called from main() to launch daemon.
+ int start(int argc, char const ** argv); ///< Called from main() to launch daemon.
/**< Normally not called directly but from the
\ref SENF_DAEMON_MAIN macro. */
void installSighandlers();
int argc_;
- char ** argv_;
+ char const ** argv_;
bool daemonize_;
std::string stdoutLog_;
\ingroup process
*/
# define SENF_DAEMON_MAIN(klass) \
- int main(int argc, char ** argv) \
+ int main(int argc, char const ** argv) \
{ \
klass instance; \
return instance.start(argc, argv); \
}
};
- int myMain(int argc, char ** argv)
+ int myMain(int argc, char const ** argv)
{
MyDaemon instance;
return instance.start(argc, argv);