Questions tagged [wrapper]

A wrapper is an OOP technique where an object encapsulates (wraps) another object, hiding/protecting the object and controlling all access to it.

Filter by
Sorted by
Tagged with
1
vote
1answer
63 views

usart driver wrapper

Could you review my usart driver wrapper please? It contains the C language Xilinx usart driver, but I write C++ programs and need to C++ usart driver. How it was designed correctly and what I have ...
-1
votes
2answers
81 views

Using a lambda to generically create an arbitrary class wrapper around some object of type T [closed]

While experimenting with some of C++'s language features, I was able to successfully design an invokable nameless function call through the use of a lambda that generically creates an arbitrary class ...
5
votes
1answer
453 views

Python wrapper for official Hacker News API

Since Hacker News launched their official API, I started working on Python wrapper for it. API v0 is fairly simple, you send a GET request with hacker news story's ID or user id, it returns data in ...
6
votes
0answers
53 views

Wrapper for Google_Service_Calendar as a Symfony service

My app interacts with Google Calendar. This Service wraps Google_Service_Calendar: ...
1
vote
0answers
38 views

API for value boxing and unboxing

This is a class representing an exponent. Its main purpose is to deal with logarithmic quantities. ...
1
vote
0answers
15 views

Wrapping a third party package class to achieve decoupling from the package

I want to create a wrapper around this third party package class so that I don't litter my app with calls to it. The idea being that if there are breaking changes to the package (rename the class or ...
3
votes
0answers
85 views

A wrapper library for League Of Legends API

I'm a new Rustacean, decided to make a wrapper for the LeagueOfLegends API. Focus is on simplicity, being able to make any API call with a simple function. I have not finished all functions however it'...
4
votes
1answer
303 views

C++ wrapper class for array of OpenGL buffer objects — just the constructors

A similar question was asked here, and I'm trying to do the same thing. But I'm trying a different approach by deriving from std::array, and This is a very focused ...
7
votes
2answers
230 views

Universal OpenGL object RAII wrapper class

I created a universal OpenGL object RAII wrapper class, that only takes care of object creation and destruction. Here's my code and reasoning behind it: I first wrote a class that would take ...
5
votes
0answers
225 views

safexl - A Python / pywin32 Excel Application wrapper

Thanks in advance for your interest in my first PyPI project. While there happen to be a number of projects out there to help with creating & consuming Excel workbooks, I was unable to find one ...
1
vote
0answers
24 views

Wrapper function that returns cached value from WinAPI call [closed]

I am writing myself a little wrapper and I decided to cache values that shouldn't change (often or at all) for returning to the user, I'm coming from the premise that the WinAPI call is more expensive ...
0
votes
1answer
53 views

Implementation of a vector of pairs

In a personal project I was working on, I had a vector of std::vector< std::pair<unsigned,char>>'s that represented a character and its position in the ...
2
votes
0answers
551 views

Wrapping C++ library in C++/CLI using shared_ptr

Background: I'm writing C++ code after a fairly long time, so I may not be up to date on the best practices, so please bear with me. I'm only trying to improve and learn. Problem I need to write a ...
1
vote
1answer
267 views

Java wrapper for a movie database API

I am still a beginner and I would love to hear some feedback on a small wrapper I wrote for the TMDb API (https://developers.themoviedb.org/3/getting-started/introduction). It is used for queries on a ...
8
votes
1answer
213 views

WPF BindableProperty<TValue> to Reduce Boiler Plate

I'm sure anyone who has used WPF is familiar with the irritating boilerplate code surrounding properties, usually of this form. ...
4
votes
1answer
64 views

Wrapper class for mediainfo

I made the following wrapper for the mediainfo command line. I did this mainly because mediainfo gives me more information than ...
2
votes
1answer
148 views

Wrap that uses filesystem in C++

This is a wrap that queries the number of files and folder from a given directory, also list the folders and files into a vector. I have posted another wrap in this discussion that do the same things ...
4
votes
2answers
311 views

Wrapper class for adding elements to HashSet

I have many object of class Test. I want to be sure that among them, there are no two objects o1 and ...
2
votes
1answer
58 views

REST call helper function returns empty response on timeout errors [closed]

Please review my code where I want to handle the timeout errors and send parsed JSON response if any. There are times when a POST request does not ALWAYS return JSON code. ...
2
votes
0answers
115 views

SharedPreferences singleton wrapper

I was wondering wether my implementation of the PreferenceService below is thread safe or could cause memory leaks. Android Studio gives me the warning "Do not place Android context classes in ...
3
votes
1answer
3k views

A wrapper class for Sessions in PHP

I have been using $_SESSION, $_POST, $_GET, $_SERVER ...
1
vote
0answers
181 views

Wrapper for GMP in C++

I'm writing a C++ high precision library based on GMP, sample code(files which have to be added to project): ...
1
vote
0answers
142 views

TypeScript Salesforce client library wrapper

I have made a class which wraps the JSForce Salesforce API Client: ...
5
votes
2answers
385 views

Wrapper for Python's argparse class

I'm just trying to learn python: I tend to write my own customized wrappers arround "more complicated" python functionalities so that i can use them more easily, more consistent, easier to change in ...
4
votes
2answers
187 views

Generic wrapper for single value or array of values

I'm writing a chart.js port for c# blazor (you can find it here) using C# 8.0 with .NET Core 3 (latest preview). In chart.js there is this thing called indexable options. It let's you use either a ...
9
votes
2answers
665 views

Proxy/Wrapper class for a dynamic object from a SOAP API

I have to interface with a horrible PHP SOAP API that returns nested arrays of strings. I've written a helper that can parse the SOAP response and return a dynamic object but I need at least some ...
12
votes
2answers
494 views

Data marshaling wrapper for a TCP server

After a lot of research, I created this wrapper which I think fits very well to my needs. My project is a TCP server and I will be using this wrapper every time the server receives a packet. Basically,...
2
votes
0answers
84 views

Managed Vulkan API Wrapper (create/destroy an instance)

I'm trying to follow this Vulkan API tutorial and have come up with an implementation that I don't completely loathe. The VkUtf8StringArray class is my least ...
4
votes
1answer
129 views

C++ wrapper around uniform mt19937 SequenceContainer [closed]

With the following interface in mind EasyRandom<unsigned int> prng(a, b); auto x = prng(); // scalar auto v = prng(10); // vector I wrote the following ...
4
votes
2answers
174 views

F# wrapper to generate SHA256 signature for a file

I've created the following module to allow me to generate a SHA256 signature for a file. (In real life this is used to verify an image file hasn't been amended). The cut down code looks like this: <...
1
vote
1answer
59 views

Wrapper for LeagueAPI in Node.js

Full code is here: https://github.com/LionelBergen/LeagueReddit I'm creating a wrapper for the LeagueAPI in Node.js. This includes methods to call various endpoints and classes to map the outputs &...
1
vote
1answer
49 views

Wrapping certain elements in an array with an array with PHP

I have a function that's doing this correctly, but I feel as though this can be done (possibly) with minimal code, with recursion, but I'm just wracking my brain. Basically I have JSON that gets ...
2
votes
1answer
29 views

Using deftype to create a wrapper class for byte arrays

I want to create a wrapper class for byte arrays so that I can use them as keys in fastutil's Object2LongAVLTreeMap. I have ...
5
votes
2answers
138 views

Automatic RAII wrapper for concurrent access

Probably many people had to work with multithreaded applications with C++ and can understand how messy can be fine-grained locking of objects. So once in a while I came to idea of implementing some ...
0
votes
1answer
31 views

A D wrapper around a C function

Any problems with this D wrapper around libcomcom_run_command() C function from C library libcomcom? Does it work as expected? Is it idiomatic? Is it the right way ...
1
vote
1answer
149 views

Prepare a cross-platform QT C-wrapper class for unit testing and mocking

The situation I recently started a cross platform QT project (arm, linux-x86, windows) that aims to interact with CAN-Bus hardware. I want to learn and get used to unit testing from scratch as good ...
3
votes
3answers
1k views

Proper use of a generic value type wrapper class

I have a wrapper class: ...
8
votes
3answers
290 views

Executable wrapper around Perl script on Windows

I have ack (the searching tool) "installed" as a single file at C:\ack\bin\ack.pl on a Windows 10 machine and was wondering how to make it executable from the ...
3
votes
1answer
93 views

FutureTaskWrapper for Java

I did not like that get synchronizes every time I call it - because I may be calling it more than once. So I wrote the wrapper for the future interface which keeps ...
5
votes
1answer
7k views

PHP MySQLi wrapper class

I've created a minimal PHP-MySQLi database wrapper class that can be used to run insert, select, update and delete queries via prepared methods with ease. Here's the wrapper class: ...
1
vote
1answer
107 views

Wrapper for a sales API, with a fluent interface

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
1
vote
2answers
46 views

Running shell script as root via external binary

I'm not an experienced Linux user and I wanted an easy way to run shell scripts as root from a PHP script, I came up with this: ...
2
votes
2answers
746 views

Wrapper for a raw array so that it can be passed to templates expecting Standard Library containers

I am working with a code base where unfortunately I cannot replace all raw arrays with std::array. The spec provides no guarantee that the memory layout of a ...
7
votes
1answer
206 views

Linux/Mac hashing SHA-1

To do password exchange on the SQL server I need to use SHA-1 to generate a hash (no plain password exchange). This is done differently on Linux/Mac so I abstracted it slightly. ThorCryptWrapper.h <...
4
votes
2answers
124 views

Automatic exception wrapper in java

There's a lot of place in my code where I need to do something like this ...
8
votes
1answer
2k views

Wrapping libusb library in C++

I want to use libusb library in my C++ application. I have created classes which wraps libusb functions. You can see that libusb API is split into 8 sections: http://libusb.sourceforge.net/api-1.0/...
8
votes
1answer
436 views

Wrapper around Python's poplib.POP3 and poplib.POP3_SSL

From time to time I use Python's poplib module to inspect/manipulate POP3 mailboxes, often interactively. I find the interface very cumbersome however, so I decided to try to make a wrapper that's ...
2
votes
0answers
41 views

Undocumented API client / wrapper in Python

Got the go ahead to make an API wrapper for an undocumented web API. Hoping to get some feedback on my code and design choice. I've been going back and forth and haven't been able to really feel ...
6
votes
1answer
8k views

C++ syslog wrapper

Some things I want to achieve with the logging code. Code is for an embedded device. Code must only work for Linux. C++11 can be used. Syslog daemon is running on the device. So I want to wrap syslog....