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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:55:56+00:00 2026-06-17T19:55:56+00:00

I am wrapping a library which I did not write to make it more

  • 0

I am wrapping a library which I did not write to make it more user friendly. There are a huge number of functions which are very basic so it’s not ideal to have to wrap all of these when all that is really required is type conversion of the results.

A contrived example:

Say the library has a class QueryService, it has among others this method:

WeirdInt getId() const;

I’d like a standard int in my interface however, I can get an int out of WeirdInt no problem as I know how to do this. In this case lets say that WeirdInt has:

int getValue() const;

This is a very simple example, often the type conversion is more complicated and not always just a call to getValue().

There are literally hundreds of function calls that return types likes these and more are added all the time, so I’d like to try and reduce the burden on myself having to constantly add a bajillion methods every time the library does just to turn WeirdType into type.

I want to end up with a QueryServiceWrapper which has all the same functionality as QueryService, but where I’ve converted the types. Am I going to have to write an identically names method to wrap every method in QueryService? Or is there some magic I’m missing? There is a bit more to it as well, but not relevant to this question.

Thanks

  • 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-17T19:55:57+00:00Added an answer on June 17, 2026 at 7:55 pm

    If the wrapper methods for QueryService have a simple pattern, you could also think of generating QueryServiceWrapper with some perl or python script, using some heuristics. Then you need to define some input parameters at most.

    Even defining some macros would help in writing this wrapper class.

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

Sidebar

Related Questions

I am creating a static library which I am wrapping into a .framework for
Do you know about any good library wrapping posix and linux functions and structures
Is there any (preferably native) C# library which allows me to send some messages
I'm trying to write classes which handle different number types. I know that C#
I'm wrapping a library with SWIG (Python as target). The library functions contains parameters
Say, I have mylibrary.ml which provides wrappings to library.c and I want to bytecode-compile
I'm wrapping a library for my own use. To get a certain property I
We use an open source library written in C# wrapping Windows BITS COM component.
I'm wrapping the FM-SBLEX Saldo program in a Java library. Saldo is written in
Our framework requires wrapping certain functions in some ugly boilerplate code: def prefix_myname_suffix(obj): def

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.