Questions tagged [opaque-pointers]

In computer programming, an opaque pointer is a special case of an opaque data type, a datatype declared to be a pointer to a record or data structure of some unspecified type.

Opaque pointers are a way to hide the implementation details of an interface from ordinary clients, so that the implementation may be changed without the need to recompile the modules using it. This benefits the programmer as well since a simple interface can be created, and most details can be hidden in another file. This is important for providing binary code compatibility through different versions of a shared library, for example.

86 questions
0
votes
1 answer

How do I declare an opaque anonymous structure defined in third-party?

I am working on a third-party module wrapper. I hope my main header file does not have any third-party related header files. Every parameter type and return type are opaque by only declaring it. But there is a anonymous structure defined like the…
Chen OT
  • 3,486
  • 2
  • 24
  • 46
0
votes
1 answer

Is it possible to exclude template member variables by conditions on template arguments?

I am currently writing a class which should specialize depending on a template argument. I am now wondering whether it is possible to leave out certain member variables for specific specializations to be more exact depending on whether a numeric…
Blackclaws
  • 436
  • 5
  • 20
0
votes
1 answer

Core Graphics Opaque type, what are they and how?

I am learning Core Graphics and particularly learning about the CGContextRef. My question is about the syntax and implementation details (if they are knowable) of opaque data types. I understand that opaque types such as CGContextRef are…
0
votes
1 answer

Trouble using opaque pointers in Objective C++

The answer to this quesion explains that opaque pointers are a good way to include C++ member variables in an Objective C++ header. I'm getting compile errors when trying to follow the example. Here's the relevant code from my header, with the…
morgancodes
  • 25,055
  • 38
  • 135
  • 187
0
votes
0 answers

templated opaque forward declaration

I am trying to create a synchronized double ended queue that will have different implementations on different OSs (for example, std:: mutexes and condition variables on Android, Windows, Linux, etc - implementation in sync_deque_stl.cpp; grand…
ihi
  • 107
  • 1
  • 9
0
votes
2 answers

Opaque Structure Pointer

In my library, I have an instance structure, which contains everything needed for the library, this is so you can define multiple instances of the library. The library requires the user to define their own extension, or custom variables. This is…
Jimmay
  • 959
  • 3
  • 13
  • 27
0
votes
1 answer

Detect transparency in div for .click purposes?

I've got three elements layered on top of one another, and each of them contains some transparency. There is no transparency in the middle, just around the edges. I want to be able to click the div in the background, but because the transparent…
Mr. Lavalamp
  • 1,860
  • 4
  • 17
  • 29
0
votes
1 answer

Expose an opaque type to python using swig

I'm trying to wrap an opaque type in C using SWIG but I cant understand how to. I have three files listed below: simplelib.c: #include #include #include "simplelib.h" struct _simplelib_my_type { double x; double…
Rickard
  • 1,754
  • 1
  • 12
  • 17
0
votes
1 answer

Are templates and opaque pointers inheritenly incompatible?

Pretty much is all in the question, but is there any way to get the encapsulation you get from using an opaque ptr with a template class? (My gut is "no", because the compiler has to be aware of everything at compile time) Something like this, where…
IdeaHat
  • 7,641
  • 1
  • 22
  • 53
0
votes
2 answers

Upcasting opaque pointer

I'm trying to use pimpl idiom. In particular, the implementation class would implement another interface: // public_class.h class PublicClass { public: /* public interfaces here */ private: class _PublicClass_impl; friend class…
touko
  • 410
  • 4
  • 7
-3
votes
12 answers

Value of type 'Category' (aka 'OpaquePointer') has no member 'name'

I'm working with Swift in Xcode and I receive the following error: Value of type 'Category' (aka 'OpaquePointer') has no member 'name' And I've looked everywhere but I can't find a solution. Does someone know what to do? Here is a screenshot:
Luis
  • 61
  • 2
  • 12
1 2 3 4 5
6