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 758023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:25:51+00:00 2026-05-14T15:25:51+00:00

Need help… I have 3 classes, Manager which holds 2 pointers. One to class

  • 0

Need help…

I have 3 classes, Manager which holds 2 pointers. One to class A another to class B . A does not know about B and vise versa.

A does some calculations and at the end it puts 3 floats into the clipboard.
Next, B pulls from clipboard the 3 floats, and does it’s own calculations.
This loop is managed by the Manager and repeats many times (iteration after iteration).

My problem:
Now class A produces a vector of floats which class B needs. This vector can have more than 1000 values and I don’t want to use the clipboard to transfer it to B as it will become time consumer, even bottleneck, since this behavior repeats step by step.

Simple solution is that B will know A (set a pointer to A).
Other one is to transfer a pointer to the vector via Manager
But I’m looking for something different, more object oriented that won’t break the existent separation between A and B

Any ideas ?

Many thanks

David

  • 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-14T15:25:51+00:00Added an answer on May 14, 2026 at 3:25 pm

    It kind of sounds like you are writing a producer / consumer pair, who may communicate more easily over a (probably thread-safe) queue of floats.

    In other words: the “queue” is like the vector you are currently using. Both A and B will have a reference to this queue. A runs calculations, and writes floats to the queue (possibly three at a time, if that’s what you need). B checks the queue, or possibly is “signaled” by A that the queue is ready, and grabs the floats from the queue to process them.

    For more info, google (or search Stack Overflow) for “producer consumer” and/or “queue”, you’ll probably find a lot of useful info.

    (e.g. Multithreaded Work Queue in C++)

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

Sidebar

Ask A Question

Stats

  • Questions 531k
  • Answers 531k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One problem - you're not disposing of the WebResponse. It… May 16, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer serialStr[] = (i > 0 ? "|" : "") +$(elm).children().html()… May 16, 2026 at 11:48 pm
  • Editorial Team
    Editorial Team added an answer You can use Translation to slide the contents of the… May 16, 2026 at 11:48 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Need help with technical-designing of a website. I have a main page with a
Need help with my simple PHP menu. I'd like to have something like that:
Need help in figuring out a tool which can convert a flash (.swf) chart
I have a regex issue that I need help with. Its trying to validate
Need help with reading special characters within my VB code. ASCII code Char(34) =
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
Need help resolving a display problem on Fancybox content in IE8. It works fine
Need help compiling in C. When using GCC at home (Windows, 3.4.5), the code
Need help writing a script downloads data from google insight using c# this is
Need help with a math issue: i need to get the true angle from

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.