Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
0answers
26 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 ...
0
votes
1answer
21 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 ...
5
votes
2answers
68 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
2answers
38 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 ...
3
votes
0answers
19 views

Wrapper for Google_Service_Calendar as a Symfony service

My app interacts with Google Calendar. This Service wraps Google_Service_Calendar: ...
1
vote
1answer
56 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 ...
7
votes
3answers
164 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
85 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 ...
1
vote
1answer
68 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
44 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
192 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 ...
4
votes
2answers
106 views

Automatic exception wrapper in java

There's a lot of place in my code where I need to do something like this ...
2
votes
0answers
35 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 ...
8
votes
1answer
238 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 ...
4
votes
1answer
3k 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: ...
5
votes
1answer
3k 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....
4
votes
1answer
2k views

Concurrent HashSet

I've recently been using HashSet and locking on each method, I found this to not only be a lot of work (was using it in a lot of places) but I started to see inconsistency in my code. I later decided ...
2
votes
0answers
62 views

3D wrapper for turtle

I am a Python enthusiast, but I'm never sure if what I'm doing is Pythonic. I have made my own graphics wrapper for Python's turtle. I don't entirely know if I did this right, so I have come here for ...
6
votes
1answer
420 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 ...
1
vote
0answers
2k views

Serial Port Wrapper with Internal Blocking Buffer

Here I have some complete working code but some aspects seem questionable to me. What I have done is written a wrapper for the Microsoft serial port (...
2
votes
0answers
237 views

Wrapper for sql.Connection

I wrote wrapper for Connection. It uses my Connection pool implementation. When the wrapper closes, the connection goes back to pool. ...
0
votes
1answer
63 views

Promisifying a third-party JS library with minimal code overhead

Context and Existing Code I am trying to "promisify" a third-party authentication library (auth0-js) written in JavaScript. Right now it uses callback functions and there are no plans to expose an <...
1
vote
1answer
43 views

TweetResolver class, to be used in a graphql project

This is my module TweetResolver (tweet-resolver.js) : ...
5
votes
1answer
691 views

An iterator wrapper that on dereferencing, returns the value of a member (function)

I wrote a simple iterator wrapper that can be used in e.g. std::find and std::copy and iterator pair constructors to search on ...
1
vote
2answers
1k views

Extensive use of exception for database wrapper

My favourite programming language is Java and I usually use JDBC for database operations. I'm using Swift for one of my projects and I should use a database. The problem is SQLite is only available ...
6
votes
2answers
112 views

MongoDB Perl Wrapper

I'm trying to create a custom "mongodb perl wrapper". I created the following perl module, which local on my machine runs. My questions to the community are: Would you create the module different? Do ...
0
votes
1answer
152 views

Using dynamic to avoid code duplication when wrapping an API

I am dealing with 3 different types of cameras from the same manufacturer and want to write a wrapper for their API. The API structure is like this: Camera1 and Camera2 use the class ...
2
votes
0answers
333 views

Reference wrapper for functions overloadings and universal references

I have design a little class to allow to overload a function with universal references for a known type, but I'm not sure if that class will work as expected in any contexts. The indended purpose is ...
4
votes
1answer
275 views

OpenGL 4.5 Core Buffer wrapper

I recently wrote this OpenGL buffer wrapper which covers the 4.5 Core specification. I feel like the typed interface could be done better. Any feedback is greatly appreciated. ...
2
votes
1answer
76 views

Wrapping messages into common header, ANSI C

I have a protocol where I send lots of different messages using two or three different header types (let's call them "Type A" and "Type B" messages). To simplify unit testing, my idea was to do ...
4
votes
1answer
451 views

Simple C++ wrapper over libYAML

For a personal project, I need to parse YAML file. I chose to use C-based libYAML instead of yaml-cpp, because: I try to keep my dependencies to what's commonly installed and Debian statistics show ...
2
votes
1answer
220 views

Wrapper class for executing database queries

I have a wrapper class for executing database queries from an ASP.NET application. Please provide suggestions on how I can improve this class. It is working fine. Anyone can use this class in their ...
1
vote
0answers
121 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): ...
7
votes
1answer
156 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 <...
6
votes
1answer
936 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/...
3
votes
3answers
1k views

Enum wrapped in a struct

I was thinking about how I was going to use some enums I made, how I was going to make sure they had valid values and how to call the class which would contain the necessary extensions methods. And ...
1
vote
1answer
333 views

Multithreaded cURL wrapper

The following is a class for curl wrapper. This class will be called like: ...
0
votes
1answer
221 views

Caching wrapper for digest computation

I need to review this code: ...
4
votes
2answers
2k views

C++ Wrapper for cURL: Multithreading and serializing asynchronous ops

I did this library to help me from one of my projects and decided to publish it on GitHub hoping people might find it useful, convenient and easy to use in their projects too. It's a header-only ...
6
votes
1answer
137 views

Random generator extension for VSCode

Background A VSCode extension that uses Chance.JS to generate random data types. Concerns My main concern is that there are 4 levels of function references that feels like a hack. From ...
1
vote
0answers
200 views

simpler pattern/extension built on top of telepot (telegram bot api wrapper)

simpler pattern/extension built on top of telepot (telegram bot api wrapper) filter usage ...
2
votes
1answer
170 views

Wrapping Checkers

The next post in my Checker series: The C# wrapper for my F# library to make it cleaner for these methods to be called from C# code. GeneralTypes.cs ...
3
votes
1answer
193 views

C++ Dirent.h “Wrapper”

I do not want to call this a wrapper, but no other name comes to mind right now, so I'll use it incorrectly for the rest of the question - It's just a class that adds C++ functions to ...
4
votes
1answer
218 views

C++ OpenGLBuffer class, wrapper around the raw OpenGL api

I am trying to code a thin wrapper around the OpenGL so I can use it more convenient. This class is not 100% done yet, but I don't want to do all typing for nothing. And I think the design is clear. I ...
0
votes
2answers
116 views
4
votes
0answers
219 views

PowerShell Export-CSV with Cultural Awareness

I recently had a requirement to export data to CSV in a different culture & hit an issue (see https://stackoverflow.com/a/40871162/361842). Here's my workaround: ...
1
vote
1answer
55 views

Array whose first element is arbitralily indexed – writing a container wrapper

The problem: In C++ arrays and SequenceContainers http://en.cppreference.com/w/cpp/concept/SequenceContainer (std::array, ...
5
votes
1answer
30 views

Short header file for safe CLI input handling in C

Proper input handling is a pain in the butt in C, so as part of a project of mine, this header is used to handle reoccurring command line input tasks such as input loops, reading lines and tokenizing ...
-1
votes
2answers
184 views

Wrapper Connection PDO PHP [closed]

This is my wrapper, how can i improve this? (With a Singleton too) ...
3
votes
2answers
66 views

Python 'wrapper' around `dig` for easier TSIG signing of queries

I wrote this Python script as a utility script for me. It's something that could be achieved in a simple shell script or alias, but it wasn't 'verbose' enough for me in that format, or customizable. ...