Changeset - 271a7134db1a
[Not reviewed]
0 5 0
HanzZ - 14 years ago 2011-02-14 12:43:02
hanzz.k@gmail.com
Docs
5 files changed with 36 insertions and 12 deletions:
0 comments (0 inline, 0 general)
examples/usermanager/main.cpp
Show inline comments
 
@@ -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);
 
include/transport/config.h
Show inline comments
 
@@ -38,6 +38,7 @@ namespace Transport {
 

	
 
typedef boost::program_options::variables_map Variables;
 

	
 
/// Class used to load.
 
class Config {
 
	public:
 
		Config() {}
include/transport/logger.h
Show inline comments
 
@@ -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:
include/transport/transport.h
Show inline comments
 
@@ -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<std::string> &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<std::string> &features);
 

	
 
			/// Returns Jabber ID of this transport.
 
			/// \return Jabber ID of this transport
 
			Swift::JID &getJID() { return m_jid; }
 

	
 
			boost::signal<void (const Swift::ComponentError&)> onConnectionError;
src/transport.cpp
Show inline comments
 
@@ -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<std::string> &features) {
 
	m_discoInfoResponder->setTransportFeatures(features);
 
}
0 comments (0 inline, 0 general)