Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 24th, 2006, 4:20 PM   #11
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Powerpoint.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 24th, 2006, 8:38 PM   #12
weeb0
Newbie
 
Join Date: Jan 2006
Posts: 17
Rep Power: 0 weeb0 is on a distinguished road
No powerpoint in linux ;-) lol

we are lucky!
weeb0 is offline   Reply With Quote
Old Jan 24th, 2006, 8:48 PM   #13
Jason Isom
Programmer
 
Join Date: Dec 2005
Posts: 53
Rep Power: 3 Jason Isom is on a distinguished road
You have Impress with OpenOffice. Although I'm not sure if there is a tool specific to Powerpoint that you're doing UML in?
Jason Isom is offline   Reply With Quote
Old Jan 24th, 2006, 9:16 PM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
No specific tool. I make what I want. I'm a ol' boy that predates formal UML, thus have no problems.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jan 25th, 2006, 12:34 AM   #15
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
You can use Dia in linux.
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old Jan 31st, 2006, 7:49 PM   #16
weeb0
Newbie
 
Join Date: Jan 2006
Posts: 17
Rep Power: 0 weeb0 is on a distinguished road
OK! I'm back :-)!

I followed your advices and I wrapped the network functions.

Now, I would like to do clean job. I'm currently working on my Network class. Now, I have a class containing the following functions :

class cNetwork
{
	cnetwork();
	cnetwork(int port);
	~cnetwork();
	void send_to(char *buffer,int length);
	int receive_from(char *buf,int buf_size);
	void bind_to(void);
	void wait_connection(void);
};

I think it should be a good thing to separate the server functions of the generic ones ("send_to"/"receive_from") and I should add a "connect_to" one.

When I have a server, if I accept a connection, a new socket number is created, so I need to have 2 socket variable in the class. It's not needed when I have to use a client connection. So, I would like to build the following inheritance of class:

parent : cNetwork (containing the socket and receive_from / send_to functions)
childrens :
cNetwork_server (containing the bind, accept...)
cNetwork_client (containing the connect and other usefull functions to search the dns etc...)
This mean the cNetwork_server class need to access to the socket variable of the parent class. Is this a good practice to use ?
Can you see another way to do this ? Any advice ???

Here the code of the class to be sure everybody can understand what I would like to do:

class cNetwork
{
public:
    cNetwork();
    ~cNetwork();
    void send_to(char *buffer,int size);
    int receive_from(char *buffer,int size);
protected:
    int socket;
};

class cNetwork_server : cNetwork
{
    /* I must use the variable socket of the parent class withing the functions of this class */
    cNetwork_server();
    ~cNetwork_server();
    void bind_to();
    void wait_for_connection();
};

class cNetwork_client : cNetwork
{
    /* I must use the variable socket of the parent class withing the functions of this class */
     cNetwork_client();
     ~cNetwork_client();
     void connect_to();
};

thank you for your precious help!
weeb0 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:31 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC