Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8190627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:43:04+00:00 2026-06-07T03:43:04+00:00

I was about to begin porting a relatively large game from iPhone Obj-C to

  • 0

I was about to begin porting a relatively large game from iPhone Obj-C to a platform neutral C++. In our game, we made heavy use of the NSNotificationCenter for notifying menus and game items of downloads and cache updates from our server.

I was thinking of re-creating the NSNotificationCenter using a singleton class and then having any class which would receive notifications inherit a NotificationReceiver base class using multi-inheritance. The singleton would keep a Map of notification names that would keep an array of pointers to the base class. When the notification is sent, it would then call a virtual member in the base class of the receivers which could be overridden.

Is there a better design pattern to use in C++ for this type of operation?

Would there be a better way to implement this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:43:06+00:00Added an answer on June 7, 2026 at 3:43 am

    Would there be a better way to implement this?

    Yes – there is no need to enforce inheriting a specific interface if you use e.g.:

    • functors like Boost.Function or C++11 std::function in combination with Boost.Bind/std::bind for the callbacks
    • signaling systems like Boost.Signals2.

    Also keep in mind that if all you need is a single instance for the notification center, it doesn’t need to be a singleton.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: iPhone development on Windows We are about to begin our first med-tech
I am new to OpenGL ES, and I'm about to begin a 3D game
I'm a developer who's about to begin building a relatively complex web application. I
I'm about to begin a new project and plan to use YUI and my
I'm about to begin the development of an educative video game. I've decided to
I'm about to begin a reasonable pure ruby project becoming from a Java and
I'm about to begin development of an iPhone app. The app itself is fairly
I'm relatively new to J2ME and about to begin my first serious project. My
I'm about to begin work on translating client's website into spanish and french and
My question concerns Google Web Toolkit (GWT). I'm about to begin development for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.