1     #ifndef W2EX4_H
2     #define W2EX4_H
3   
4     //
5     // Week 2, Example of Static Members and Methods
6     //
7     // This class represents a network connection.
8     // Due to limited hardware, only 10 network
9     // connections are possible at a time. Because
10    // we don't trust programmers to check the number
11    // of connections themselves, we force them to
12    // use a static method to create a network connection.
13    // If no connections are available, the method
14    // returns 0.
15    //
16   
17    class Network
18    {
19    public:
20        static Network *makeConnection (ipaddress);
21   
22        void sendData (char *);
23        char *getData ();
24   
25    private:
26        Network ();
27        Network (const Network &);
28        Network (ipaddress);
29   
30        static int numConnections;
31    };
32   
33    #endif