Creating an In-process Adapter in C/C++

This section reviews how to write an in-process adapters in C/C++ to communicate with the Sybase CEP Server.

In-process adapters are compiled into dynamically linkable libraries that are called "shared object" libraries on most UNIX-like operating systems. These libraries are linked to the server, and the code in them runs as part of the server process.

This chapter explains how to create simple adapters for reading from and writing to a Sybase CEP Server in the C and C++ programming languages (this API allows you to write both input adapters and output adapters). Since this example is provided in source form, modifications are easily performed.

In-process adapters tend to have lower overhead than out-of-process adapters. They also give you access to some internal features in the engine; for example, you can call a function to find out the schema of a stream.

For an adapter to function, it must be able to attach to its Sybase CEP stream and convert data to (or from) the Sybase CEP Server representation. These two tasks - communication and conversion - are independent of each other. The primary purpose of the In-process Adapter API is to provide the functions needed to communicate with the Sybase CEP Server. You must write your own conversion functions that are appropriate for the source (or destination) of the data.