Jump to content
  • Advertisement
Sign in to follow this  
Shawn Harris

Interprocess communication

This topic is 4661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, Currently I'm working on a project. I have spent some time trying to design the architecture, but now I'm stuck. This is my first large 'gamish' project. Basically, I am trying to use an entity system. I have numerous classes that provide different services. For example I have: a class CRenderManager that deals with all aspects of rendering objects, and a CObjectManager that deals with the management of the entity objects. The way I have designed this thing is that I need to allow different components/objects to be able to request a 'service' from another component/object. For example I have an CEventManager and for whatever reason my code may decide that a new event is occuring and I need a new object say a rock rolling down a hill. So the event manager would need to request that a new object of type 'rock' be created through the Object Manager. So various 'request' need to be made to other objects. I have read that delegates can be used for this type of situation. I'm just wondering if anyone has had this type of expeince before, also I would gladly accept criticism on the design. Thanks all. Pleas ask if I have not explained things well enough.

Share this post


Link to post
Share on other sites
Advertisement
I re-read your post and I think I understand a little better; you want to use delegates for the event scheduler? That's a flexible way to post-pone execution of a function. I think I'd do as much work as possible upfront, and then just schedule a commonly used delegate, e.g. one that injects an entity into the world:

Do you have interface defintions? e.g. IObjectManager, IEventManager?


//Initialization of whatever makes rocks
IEntity* rock = object_manager->Locate("Rock");

//Run-time
IEntity* new_rock = rock->Clone();
new_rock->Position(...);
new_rock->Velocity(...);
event_manager->Schedule(Now_sec() + 120.00f, InjectEntity(new_rock));



Oh, and more troubling is your topic, "Interprocess Communication"; was that a mistake? Or do you need to remote something?

[Edited by - Shannon Barber on August 1, 2005 7:20:26 PM]

Share this post


Link to post
Share on other sites
I'm not sure why you think my title is troubling, but I can explain it. I am using the term process to refer to the individual components within the application that are performing a specialized task. If you prefer I could say intra-application communication or intra-process communication (considering process to be the "single process" of the application). Sorry if the name seems troubling, but I think it is fairly straight foward when you read the text. Nevermind, it doesn't matter.

Moving on to your question. I have not specifically designed Interfaces as yet, but I hope to bring that into my design at some point.

I am using the delegates only when needed. I think using these delegates is a half way between data hiding and global variables. The other solution was to use member function pointers which defeated the purpose of using a function pointer in my situation because of the address offseting that is used. So i'm happy with the delegates they seem to work well. I am not only using the Delegates in the eventSceduler, but also within the object manager to request resources for a new object, within the object manager to report when an object with resources is destroyed etc.

Share this post


Link to post
Share on other sites
Interprocess means communication between different processes. Just like international refers to different nations. You have just 1 process here so the term you used is actually incorrect, hence Shannon's 'trouble'.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!