Click here to Skip to main content
15,886,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Compiler generated code Pin
Peter_in_278013-Jul-17 16:44
professionalPeter_in_278013-Jul-17 16:44 
QuestionInterprocess communication in C without pipes or disk Pin
Chris Maunder12-Jul-17 13:14
cofounderChris Maunder12-Jul-17 13:14 
AnswerRe: Interprocess communication in C without pipes or disk Pin
Espen Harlinn12-Jul-17 14:03
professionalEspen Harlinn12-Jul-17 14:03 
GeneralRe: Interprocess communication in C without pipes or disk Pin
leon de boer12-Jul-17 18:49
leon de boer12-Jul-17 18:49 
AnswerRe: Interprocess communication in C without pipes or disk Pin
Randor 13-Jul-17 14:08
professional Randor 13-Jul-17 14:08 
GeneralRe: Interprocess communication in C without pipes or disk Pin
Chris Maunder19-Jul-17 6:01
cofounderChris Maunder19-Jul-17 6:01 
AnswerRe: Interprocess communication in C without pipes or disk Pin
Joe Woodbury17-Jul-17 10:53
professionalJoe Woodbury17-Jul-17 10:53 
Questionwhich one would be better? Pin
bestbear11-Jul-17 1:51
bestbear11-Jul-17 1:51 
I'm working on a GAME SERVER program. there is a design problem confused me.

Basic Situation:
1. the host object just as bellow has a lot of child objects. eg, 20 child objecs.
2. the host would be new and delete very frequently.
3. all the operations from the child would be invoked like this :
pHost->GetA()->DoSomething(),and also very frequently.
4. CHost1 use objects as child,CHost2 use poniter and new child in constructor.

my question is:
1. since I would new and delete CHost very ofen,may be in the server loop, is CHost2 a bad design?
2. since all the method of the child would be invoked like this:
pHost->GetA()->DoSomething(). is this indirect call cost a lot compare to
pHost->DoSomething, because it happens a lot.

If CHost2 is a bad design, I would use CHost1 or use CHost2 and a CHost2 Pool.
If Indirect call cost a lot.I would only use CHost3 without child objects,and all method would be like pHost->Dosomething

Thank you all.
ps I can't use the code button to format the code,I tried chrome and ie,why

class CHost1
{
public:
CHost1(){}
public:
C1* Get1();
C2* Get2();

CN* GetN();

private:
C1 m_1;
C2 m_2;

CN m_n;
};

class CHost2
{
public:
CHost2()
{
m_p1 = new C1;
m_p2 = new C2;

m_pN = new CN;
}
public:
C1* Get1();
C2* Get2();

CN* GetN();

private:
C1* m_p1;
C2* m_p2;

CN* m_pN;
};

AnswerRe: which one would be better? Pin
Jochen Arndt11-Jul-17 3:41
professionalJochen Arndt11-Jul-17 3:41 
AnswerRe: which one would be better? Pin
leon de boer11-Jul-17 5:50
leon de boer11-Jul-17 5:50 
AnswerRe: which one would be better? Pin
bestbear11-Jul-17 17:18
bestbear11-Jul-17 17:18 
Questionwhich one would be better? Pin
bestbear11-Jul-17 1:18
bestbear11-Jul-17 1:18 
Questionquestions plz solve throught c or c++ Pin
Member 1330375110-Jul-17 22:51
Member 1330375110-Jul-17 22:51 
AnswerRe: questions plz solve throught c or c++ Pin
CodeWraith10-Jul-17 23:21
CodeWraith10-Jul-17 23:21 
AnswerRe: questions plz solve throught c or c++ Pin
Richard MacCutchan11-Jul-17 0:21
mveRichard MacCutchan11-Jul-17 0:21 
AnswerRe: questions plz solve throught c or c++ Pin
Patrice T16-Jul-17 17:34
mvePatrice T16-Jul-17 17:34 
QuestionHow to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici10-Jul-17 8:07
lolici10-Jul-17 8:07 
AnswerRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Richard MacCutchan10-Jul-17 21:28
mveRichard MacCutchan10-Jul-17 21:28 
AnswerRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt10-Jul-17 21:38
professionalJochen Arndt10-Jul-17 21:38 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici11-Jul-17 8:33
lolici11-Jul-17 8:33 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt11-Jul-17 9:08
professionalJochen Arndt11-Jul-17 9:08 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici11-Jul-17 9:18
lolici11-Jul-17 9:18 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
lolici15-Jul-17 3:53
lolici15-Jul-17 3:53 
GeneralRe: How to save the filename retrieved from a dialog class using CMFCEditBrowseCtrl? Pin
Jochen Arndt15-Jul-17 22:00
professionalJochen Arndt15-Jul-17 22:00 
QuestionProblem in precedence of operators. Pin
parkavikkk7-Jul-17 21:25
parkavikkk7-Jul-17 21:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.