~mira-dev/mira/p2p

« back to all changes in this revision

Viewing changes to mira-client/include/Application.h

  • Committer: Alan Alvarez
  • Date: 2009-10-13 02:13:33 UTC
  • Revision ID: aalvarez@aliensoft.net-20091013021333-hysafl0zshp79v2e
- Initial commit for p2p network code.
- Removed regular network code for now.
- This only works in linux for now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef __MIRACLIENT_APPLICATION_H
22
22
#define __MIRACLIENT_APPLICATION_H
23
23
 
24
 
#include "Client.h"
25
24
#include "User.h"
 
25
#include "Service.h"
 
26
// #include "Client.h"
26
27
 
27
28
namespace miraclient
28
29
{
30
31
class Application
31
32
{
32
33
    public:
33
 
        typedef network::Client ClientType;
34
 
 
35
 
        static ClientType& get_client() { return *m_client; }
36
 
 
37
 
        static bool set_client(ClientType* _client) 
 
34
//        typedef network::Client ClientType;
 
35
 
 
36
//         static ClientType& get_client() { return *m_client; }
 
37
 
 
38
        static void set_p2p_service(network::p2p::Service* p2p_service) { m_p2p_service = p2p_service; }
 
39
        static network::p2p::Service* get_p2p_service() { return m_p2p_service; }
 
40
 
 
41
        /*
 
42
        static bool set_client(ClientType* _client)
38
43
        { 
39
44
            if (!m_client)
40
45
                m_client = _client;
45
50
        }
46
51
 
47
52
        static void unset_client() { m_client = NULL; }
 
53
        */
48
54
 
49
55
        static void start();
50
56
 
51
57
        static User              user_info;
52
58
    private:
53
 
        static network::Client*  m_client;
 
59
//       static network::Client*        m_client;
 
60
        static network::p2p::Service*  m_p2p_service;
54
61
};
55
62
 
56
63
}