<commit_before>#ifndef incl_Interfaces_ComminicationServiceInterface_h
#define incl_Interfaces_ComminicationServiceInterface_h

#include "CoreStdIncludes.h"
#include "ServiceInterface.h"

/* ---------------------------------------------
 * Interfaces for CommunicationModule usage.
 * ---------------------------------------------
 */

namespace Communication
{
	// A single contact information of individual contact.
	// Eg. jabber id:  "jid": "<EMAIL>"
	class ContactInfo
	{
	public:
		virtual void SetType(std::string type);
		virtual std::string GetType();
		virtual void SetValue(std::string value);
		virtual std::string GetValue();
	private:
		std::string type_;
		std::string value_;
	};

	typedef boost::shared_ptr<ContactInfo> ContactInfoPtr;
	typedef std::vector<ContactInfoPtr> ContactInfoList;

	// Status of one individual presence
	// * online status
	// * online message
	class PresenceStatus
	{
	public:
		virtual void SetOnlineStatus(bool status);
		virtual bool GetOnlineStatus();
		virtual void SetOnlineMessage(std::string message);
		virtual std::string GetOnlineMessage();
	private:
		bool online_status_;
		std::string on_line_message_;
	};

	typedef boost::shared_ptr<PresenceStatus> PresenceStatusPtr;

	// Individual contact on contact list
	// * name
	// * presence info
	class Contact
	{
	public:
		virtual void SetName(std::string name);
		virtual std::string GetName();
		virtual PresenceStatusPtr GetPresenceStatus();
	private:
		std::string name_;
		PresenceStatusPtr presence_status_;
		ContactInfoList contact_infos_;
	};

	typedef boost::shared_ptr<Contact> ContactPtr;

	// A participiant of session
	// * contact
	class Participiant
	{
	public:
		virtual std::string GetName();
		virtual ContactPtr GetContactData();
	private:
		ContactPtr contact_;
	};

    typedef boost::shared_ptr<Participiant> ParticipiantPtr;

	// * timestamp
	// * author
	class Message
	{
	public:
		virtual std::string GetTimeStamp(); // todo: change to proper timestamp type
		virtual ParticipiantPtr GetAuthor(); 
		virtual bool IsPrivate();
	private:
	};

	class IMMessage : Message
	{
	public:
		virtual void SetText(std::string text);
		virtual std::string GetText();
	private:
		std::string text_;
	};

	typedef boost::shared_ptr<IMMessage> IMMessagePtr;

	// Communication session consisting from participients.
	//
	// Events:
	// - InvitationsResponse(bool)
	// - ParticipientLeft(Participient)
	// - ParticipientJoined(Participient)
	class Session
	{
	public:
		virtual void SendInvitation(ContactPtr c)= 0;
		virtual void Kick(Participiant *p) = 0;
		virtual void Close() = 0;
	private:
		std::list<ParticipiantPtr> participients_;
	};

	typedef boost::shared_ptr<Session> SessionPtr;

	// todo: events:
	// - Message(IMMessage)
	class IMSession : Session
	{
	public:
		virtual void SendMessage(IMMessagePtr m) =0 ;
//		virtual void SendPrivateMessage(ParticipiantPtr p, IMMessage m);

	private:
		std::list<IMMessagePtr> im_message_history_;
	};

	typedef boost::shared_ptr<IMSession> IMSessionPtr;

	
	// Login information for communication server connection
	class Credentials
	{
		// map of key-value pairs might be better solution ?
		// Todo: settter/getters
	public: // todo: write getters & setters
		std::string type; // eg. "jabber"
		std::string server; // eg. "jabber.org"
		std::string account; // eg. "<EMAIL>"
		std::string password; // eg. "<PASSWORD>"
	};

	typedef boost::shared_ptr<Credentials> CredentialsPtr;

	// todo: events:
	// -SessionInvitation
	// -PresenceUpdate
	// -ConnectionStateUpdate
	// -IMMessage
	class CommunicationServiceInterface : public Foundation::ServiceInterface
	{
	public:
		CommunicationServiceInterface() {}
		virtual ~CommunicationServiceInterface() {}

		virtual void OpenConnection(CredentialsPtr c) = 0;
		virtual void CloseConnection() = 0;
		virtual IMSessionPtr CreateIMSession() = 0;
	};

	typedef boost::shared_ptr<CommunicationServiceInterface> CommunicationServicePtr;

} // end of namespace: Communication

#endif // incl_Interfaces_ComminicationServiceInterface_h




<commit_msg>Updated CommunicationService interface<commit_after>#ifndef incl_Interfaces_ComminicationServiceInterface_h
#define incl_Interfaces_ComminicationServiceInterface_h

#include "CoreStdIncludes.h"
#include "ServiceInterface.h"

/* ---------------------------------------------
 * Interfaces for CommunicationModule usage.
 * ---------------------------------------------
 */

namespace Communication
{

	// A single contact information of individual contact.
	// Eg. jabber id:  "jid": "<EMAIL>"
	class ContactInfo
	{
	public:
		virtual void SetType(std::string type);
		virtual std::string GetType();
		virtual void SetValue(std::string value);
		virtual std::string GetValue();
	};

	typedef boost::shared_ptr<ContactInfo> ContactInfoPtr;
	typedef std::vector<ContactInfoPtr> ContactInfoList;

	// Status of one individual presence
	// * online status
	// * online message
	class PresenceStatus
	{
	public:
		virtual void SetOnlineStatus(bool status);
		virtual bool GetOnlineStatus();
		virtual void SetOnlineMessage(std::string message);
		virtual std::string GetOnlineMessage();
	};

	typedef boost::shared_ptr<PresenceStatus> PresenceStatusPtr;

	// Individual contact on contact list 
	// aka. "Friend"
	// * name
	// * presence info
	class Contact
	{
	public:
		virtual void SetName(std::string name) = 0;
		virtual std::string GetName() = 0;
		virtual PresenceStatusPtr GetPresenceStatus() = 0;
		virtual ContactInfoList GetContactInfos() = 0;
	};

	typedef boost::shared_ptr<Contact> ContactPtr;
	typedef std::list<ContactPtr> ContactList;

	//class ContactList
	//{
	//public:
	//	virtual int GetCount() = 0;
	//	virtual int GetOnlineCount() = 0;
	//	virtual ContactPtr GetContact() = 0;
	//}

	// A participiant of session
	// * contact
	class Participiant
	{
	public:
		virtual std::string GetName();
		virtual ContactPtr GetContactData();
	private:
		ContactPtr contact_;
	};

    typedef boost::shared_ptr<Participiant> ParticipiantPtr;

	// * timestamp
	// * author
	// todo: rename to MessageInterface or IMessage ???
	class Message
	{
	public:
		virtual std::string GetTimeStamp() = 0; // todo: change to proper timestamp type
		virtual ParticipiantPtr GetAuthor() = 0; 
		virtual int GetSessionId() = 0;
//		virtual bool IsPrivate();
	private:
	};

	class IMMessage : Message
	{
	public:
		virtual void SetText(std::string text);
		virtual std::string GetText();
	private:
		std::string text_;
	};

	typedef boost::shared_ptr<IMMessage> IMMessagePtr;

	// Communication session consisting from participients.
	//
	// Events:
	// - InvitationsResponse(bool)
	// - ParticipientLeft(Participient)
	// - ParticipientJoined(Participient)
	class Session
	{
	public:
		virtual void SendInvitation(ContactPtr c)= 0;
		virtual void Kick(Participiant *p) = 0;
		virtual void Close() = 0;
		virtual int GetId() = 0;
	private:
//		std::list<ParticipiantPtr> participients_;
	};

	typedef boost::shared_ptr<Session> SessionPtr;

	// todo: events:
	// - Message(IMMessage)
	class IMSession : Session
	{
	public:
		virtual void SendMessage(IMMessagePtr m) =0 ;
//		virtual void SendPrivateMessage(ParticipiantPtr p, IMMessage m);

	private:
//		std::list<IMMessagePtr> im_message_history_;
	};

	typedef boost::shared_ptr<IMSession> IMSessionPtr;

	
	// Login information for communication server connection
	class Credentials
	{
		// map of key-value pairs might be better solution ?
		// Todo: settter/getters
	public: // todo: write getters & setters
		std::string type; // eg. "jabber"
		std::string server; // eg. "jabber.org"
		std::string account; // eg. "<EMAIL>"
		std::string password; // eg. "<PASSWORD>"
	};

	typedef boost::shared_ptr<Credentials> CredentialsPtr;

	// todo: events:
	// -SessionInvitation
	// -PresenceUpdate
	// -ConnectionStateUpdate
	// -IMMessage
	class CommunicationServiceInterface : public Foundation::ServiceInterface
	{
	public:
		CommunicationServiceInterface() {}
		virtual ~CommunicationServiceInterface() {}

		virtual void OpenConnection(CredentialsPtr c) = 0;
		virtual void CloseConnection() = 0;
		virtual IMSessionPtr CreateIMSession(ContactPtr contact) = 0;
		virtual ContactList GetContactList() = 0;
	};

	typedef boost::shared_ptr<CommunicationServiceInterface> CommunicationServicePtr;

} // end of namespace: Communication

#endif // incl_Interfaces_ComminicationServiceInterface_h





{'fraction_non_alphanumeric': 0.12378668493776407, 'fraction_numerical': 0.002969053328765559, 'mean_word_length': 3.3164120256283884, 'pattern_counts': {'":': 2, '<': 34, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7237533', 'n_tokens_mistral': 2866, 'n_tokens_neox': 2466, 'n_words': 655}