[Dec '10] Coming soon: Pantheios.Net. The same technology that allows Pantheios (C++) to be robust, succinct, extensible and highly efficient, applied to the .NET platform. Watch this space ... (or get in contact)

Pantheios

 Pantheios

 

Tutorials: Back-end Splitting

It is often the case with non-trivial applications that multiple outputs are required. For example, a Windows daemon might log to the system event log and also emit broadcast SysLog packets. To cater for such requirements, the Pantheios distribution includes a stock back-end that splits the output emitted to it (from the core) into two. This back-end is called be.lrsplit (which stands for back-end local/remote splitter).

be.lrsplit defines the required three back-end functions - pantheios_be_init(), pantheios_be_uninit() and pantheios_be_logEntry() - in terms of the following six functions, which are declared in pantheios/backends/lrsplit.h:
  PANTHEIOS_CALL(int)  pantheios_be_local_init(     char const* processIdentity
                                                  , void*       reserved
                                                  , void**      ptoken);
  PANTHEIOS_CALL(int)  pantheios_be_remote_init(    char const* processIdentity
                                                  , void*       reserved
                                                  , void**      ptoken);
  PANTHEIOS_CALL(void) pantheios_be_local_uninit(   void*       token);
  PANTHEIOS_CALL(void) pantheios_be_remote_uninit(  void*       token);
  PANTHEIOS_CALL(int)  pantheios_be_local_logEntry( void*       feToken
                                                  , void*       beToken
                                                  , int         severity
                                                  , char const* entry
                                                  , size_t      cchEntry);
  PANTHEIOS_CALL(int)  pantheios_be_remote_logEntry(void*       feToken
                                                  , void*       beToken
                                                  , int         severity
                                                  , char const* entry
                                                  , size_t      cchEntry);
(As you would expect, pantheios_be_init() is implemented in terms of pantheios_be_local_init and pantheios_be_remote_init, and so on. Please consult the implementation in the distribution for more information.)

Hopefully it should now be clear what the Local Interface Library and Remote Interface Library, mentioned in the Back-end tutorial are used for. Each is an implementation of the local or remote functions, defined above, in terms of the Implementation (Common) Library.

As with the other back-ends, you may use be.lrplit with explict or implicit linking.

With explicit linking, you must specify the libraries for be.lrplit, along with the Local Interface Library and its associated Implementation (Common) Library, and the Remote Interface Library and its associated Implementation (Common) Library. For example, if you wanted to use a local Windows Event Log and a remote Win32 SysLog, you would have to specify the following (assuming Visual C++ 7.1, static multithreaded, debug):
  pantheios.1.be.lrsplit.vc71.mt.debug.lib,
  pantheios.1.bel.WindowsEventLog.vc71.mt.debug.lib
  pantheios.1.bec.WindowsEventLog.vc71.mt.debug.lib
  pantheios.1.ber.Win32syslog.vc71.mt.debug.lib
  pantheios.1.bec.Win32syslog.vc71.mt.debug.lib
Clearly this is some effort, which is why we've provided the Library Selector Tool.

If you wanted instead to use implicit linking, you would include the following implicit link files:
  #include <pantheios/implicit_link/be.lrsplit.h>
  #include <pantheios/implicit_link/bel.WindowsEventLog.h>
  #include <pantheios/implicit_link/ber.Win32syslog.h>
As discussed in the case of Sole Interface Library, it is not necessary to include the implicit link files for the two Implementation (Common) Library libraries, because they're included in the Local Interface Library and Remote Interface Library implicit link headers.

See also

  • Essentials - essential facts you need to know about Pantheios to get up and running.
  • Pantheios Architecture - introduction to the four parts of the Pantheios architecture: Application Layer, Core, Front-end, Back-ends.
  • Downloads - download the Pantheios library (source and binaries), samples, tools and dependent projects.
  • Tutorials - tutorials on using the Pantheios library.
  • Related Material - read up on the concepts of Shims & Type Tunneling, on the STLSoft auto_buffer class, on namespace aliasing, and more ...
  • API Documentation - once you've familiarised yourself with Pantheios via the tutorials, use the online documentation for fine details on the API functions and types.
  • Project Members - see who is implementing Pantheios, and how you can help out.
  • Performance - performance tests, which demonstrate the claimed peerless performance of Pantheios.
  • Future Directions - features that are anticipated/planned, but not yet implemented.
 

Links

Support This Project

Copyright (c) 1999-2010 Synesis Software Pty Ltd

Valid XHTML 1.0 Transitional