From 271a7134db1a89027250e17e690355665490eda5 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Mon, 14 Feb 2011 12:43:02 +0100 Subject: [PATCH] Docs --- examples/usermanager/main.cpp | 2 -- include/transport/config.h | 1 + include/transport/logger.h | 10 ++++++++++ include/transport/transport.h | 30 +++++++++++++++++++++++++----- src/transport.cpp | 5 ----- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/examples/usermanager/main.cpp b/examples/usermanager/main.cpp index f41b7eab..d2a9b5da 100644 --- a/examples/usermanager/main.cpp +++ b/examples/usermanager/main.cpp @@ -26,8 +26,6 @@ int main(void) std::cout << "Can't connect to database.\n"; } - transport.setStorageBackend(&sql); - UserManager userManager(&transport); UserRegistration userRegistration(&transport, &userManager, &sql); diff --git a/include/transport/config.h b/include/transport/config.h index ae046e37..4a0700e8 100644 --- a/include/transport/config.h +++ b/include/transport/config.h @@ -38,6 +38,7 @@ namespace Transport { typedef boost::program_options::variables_map Variables; +/// Class used to load. class Config { public: Config() {} diff --git a/include/transport/logger.h b/include/transport/logger.h index 229e0f0e..ac2cd843 100644 --- a/include/transport/logger.h +++ b/include/transport/logger.h @@ -33,13 +33,23 @@ class Component; class StorageBackend; class UserRegistration; +/// Basic logging class which logs various data into std::out (standard output). class Logger { public: + /// Creates new Logger class instance. + /// \param component component instance Logger(Component *component); + + /// Logger destructor. ~Logger(); + /// Starts logging data related to StorageBackend class. + /// \param storage storage class void setStorageBackend(StorageBackend *storage); + + /// Starts logging data related to UserRegistration class. + /// \param userRegistration userRegistration class void setUserRegistration(UserRegistration *userRegistration); private: diff --git a/include/transport/transport.h b/include/transport/transport.h index 82ca4816..e7a783b6 100644 --- a/include/transport/transport.h +++ b/include/transport/transport.h @@ -42,24 +42,44 @@ namespace Transport { // CLIENT_FEATURE_CHATSTATES = 16 // } SpectrumImportantFeatures; // - // class SpectrumDiscoInfoResponder; - // class SpectrumRegisterHandler; class StorageBackend; class DiscoInfoResponder; + /// Represents one transport instance. + + /// It's used to connect + /// the Jabber server and provides transaction layer between Jabber server + /// and other classes. class Component { public: + /// Creates new Component instance. + /// \param loop main event loop + /// \param config cofiguration, this class uses following Config values: + /// - service.jid + /// - service.password + /// - service.server + /// - service.port Component(Swift::EventLoop *loop, Config *config); + + /// Component destructor. ~Component(); - // Connect to server + /// Connects the Jabber server. + /// \see Component() void connect(); - void setStorageBackend(StorageBackend *backend); - + /// Sets disco#info features which are sent as answer to + /// disco#info IQ-get. This sets features of transport contact (For example "j2j.domain.tld"). + /// \param features list of features as sent in disco#info response void setTransportFeatures(std::list &features); + + /// Sets disco#info features which are sent as answer to + /// disco#info IQ-get. This sets features of legacy network buddies (For example "me\40gmail.com@j2j.domain.tld"). + /// \param features list of features as sent in disco#info response void setBuddyFeatures(std::list &features); + /// Returns Jabber ID of this transport. + /// \return Jabber ID of this transport Swift::JID &getJID() { return m_jid; } boost::signal onConnectionError; diff --git a/src/transport.cpp b/src/transport.cpp index 7123482d..2e3e9317 100644 --- a/src/transport.cpp +++ b/src/transport.cpp @@ -31,7 +31,6 @@ namespace Transport { Component::Component(Swift::EventLoop *loop, Config *config) { m_reconnectCount = 0; m_config = config; - m_storageBackend = NULL; m_jid = Swift::JID(CONFIG_STRING(m_config, "service.jid")); @@ -75,10 +74,6 @@ Component::~Component() { delete m_factories; } -void Component::setStorageBackend(StorageBackend *backend) { - m_storageBackend = backend; -} - void Component::setTransportFeatures(std::list &features) { m_discoInfoResponder->setTransportFeatures(features); }