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

  • SEARCH
  • Home
  • 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 6569069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:34:49+00:00 2026-05-25T14:34:49+00:00

I have run into a small design predicament. It’s not really a problem per

  • 0

I have run into a small design predicament. It’s not really a “problem” per se, it’s just bothering me that I cannot find a cleaner solution 🙂 and I was hoping some of you might have some good ideas or alternative solutions.

Say I have some pieces of data that can arrive on a communications channel (serial/IP, e.t.c) out of sync and at any time. The individual pieces of data are small, say ints or floats. They relate to some state of the machine sending the data. I wan’t to design a simple “property” system, where I am alerted when a single data-item is received, or, when MULTIPLE data items have been received. For example, a single alert would be given to me, when I successfully collected two ints and a float.

Lets say the remote system can send me this:

DATA1 : float
DATA2 : int
DATA3 : int
DATA4 : double
DATA5 : short

Now, in pseudo-code, what I want to do is something like this (using macros or whatever)

PROPERTY(DATA1)
PROPERTY(DATA2, DATA3)
PROPERTY(DATA4)

that is, each property monitors a variable amount of data chunks, and sends me a SINGLE alert, when all of the pieces being monitored has changed/been filled.

At the moment I am using sigc++ which I think is a brilliant callback library. I have a working implementation, but it’s cumbersome to code, because C++ does not really support variable argument lists, in the way that I want, so what I have done so far, is to have a single class, PROPERTY, which has a number of overloaded constructors, supporting 1 to X number of arguments, which is not really “dynamic”. If I need more variables monitored, I need to make sure there is a constructor to handle the number of arguments.

Maybe it’s just me trying to over-design 🙂

  • 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-05-25T14:34:50+00:00Added an answer on May 25, 2026 at 2:34 pm

    I’d write a Property class that stores a collection of data chunks. Each chunk is either a Boost.Variant or some type of union, or a pointer to an an object that implements a data chunk interface.

    The class could be initialized like

    Property p;
    p.addInt(xI).addFloat(xF).addShort(xS);
    

    or like

    Property p = { IntVal(xI), FloatVal(xF), ShortVal(xS) };
    

    if a C++0x initializer list can be used, where IntVal etc. are wrappers that convert a more primitive data chunk type to the variant type used in the Property collection.

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

Sidebar

Related Questions

I run into a small problem (Not surprisingly, 'cause I've just started with xcode).
I have run into a common, yet difficult problem. I do not use Photoshop
I'm developing a small game in Java and I have run into a problem
I am creating a .bash_profile script, and I have run into a small problem.
Im building a small webshop and have run into a problem. The company which
I'm developing a new application in Wicket and have run into a small problem.
I am creating a small Yahtzee game and i have run into some regex
I have run into a bit of a tricky problem in some C++ code,
I have run into an issue with WPF and Commands that are bound to
I have run into this problem before but never quite solved it. I have

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.