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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:15:53+00:00 2026-05-26T08:15:53+00:00

I have this task of designing a new interface for a distributed application (multiple

  • 0

I have this task of designing a new interface for a distributed application (multiple processes running on a single computer, not physically distributed – yet) which is comprised of many graphical panel modules written in C++/OpenGL and a single module written in Ada.

The modules share information on the form of parameters (pieces of scalar non-structured information e.g.: ints, strings, floats, etc…). I intend to design an asynchronous socket based component (which I’ll call hereafter ‘Interface Component’ or IC) to be linked by each module based on Boost::Asio library with two simple ‘client’ primitives:

Put([ParameterName], [DestinationModule], [Payload], [Type])
Get([ParameterName], [Sourcemodule], [Payload])

ParameterName: Designates a unique parameter name
DestinationModule/SourceModule: Addresses a module in the system
Payload: Actual data
Type: string or value that identifies the type of the passed parameter

Each of these primitives are treated on the server-side by two corresponding functions (on the IC):

//No function parameters shown here as I don't know
//exactly how I'm going to do this
ProcessPutRequest()
ProcessGetRequest()

Because the processing of incoming commands will be started by the IC, I intend to use function handlers which will be passed to the functions above. This way each programmer responsible by each module can process incoming commands and perform the necessary type conversions on his own code.

The question is… is this possible in Ada? I know one can import functions in C++ and call it from Ada programs btu is it possible to pass function handlers from Ada to a C++ component?

(a side-question is: do you have any suggestion of a better way of implementing this interface?)

  • 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-26T08:15:54+00:00Added an answer on May 26, 2026 at 8:15 am

    Not sure what the semantics of Get() are. Does it wait for new data? return the last data received? (in which case, what happens if no data has been received yet?)

    Assuming a callback scheme and Ada 2005, you might for a start consider a spec like

    generic
       type T is private;
    package Interfacing is
       --  'put' not shown
       type Receiver is not null access procedure (Value : T);
       pragma Convention (C, Receiver);
       procedure Register
         (Parameter_Name : String;
          From_Module : String;
          To_Be_Received_By : Receiver);
    end Interfacing;
    

    I’m assuming that the IC will organise marshalling and the list of registered callbacks.

    One point to be wary of: in this scheme, the Receiver procedure is called in the context of a foreign (non-Ada) thread which may cause problems with the Ada runtime’s tasking support. Assuming you’re using GNAT, you should look at GNAT.Threads (file g-thread.ads in the runtime). You need to get the thread registered as soon as possible, for example before doing any String operations such as catenation.

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

Sidebar

Related Questions

I have some basic idea on how to do this task, but I'm not
I am new this sharepoint development and i have task in hand to do
I have this Task model: class Task < ActiveRecord::Base acts_as_tree :order => 'sort_order' end
I have this task for the project with 4 nested subprojects using Maven: For
I have this Maven task to generate Java classes from an XSD file using
I have this little rake task: namespace :db do namespace :test do task :reset
I have had no luck with this task so far so grateful for any
I have always wondered what's the best way to achieve this task. In most
Ok, I am back on this task. I have my XML properly download from
This is a simplified task which I have to solve in real project. In

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.