sourCEntral - mobile manpages

pdf

SLICE2CPPE

NAME

slice2cppe − translate Slice to IceE for C++ (embedded edition)

SYNOPSIS

slice2cppe [OPTIONS]... FILES...

DESCRIPTION

Slice to C++ compiler that generates code suitable for the embedded edition of Ice for C++.

OPTIONS

Regardless of which Slice compiler you use, a number of command-line options are common to the compilers for any language mapping. The common command-line options are:
−h, −−help

Displays a help message.

−v, −−version

Displays the compiler version.

−DNAME

Defines the preprocessor symbol NAME.

−DNAME=DEF

Defines the preprocessor symbol NAME with the value DEF.

−UNAME

Undefines the preprocessor symbol NAME.

−IDIR

Add the directory DIR to the search path for #include directives.

The following options are specific to slice2cppe.
−−header−ext EXT

Changes the file extension for the generated header files from the default h to the extension specified by EXT.

−−source−ext EXT

Changes the file extension for the generated source files from the default cpp to the extension specified by EXT.

−−add−header HDR[,GUARD]

This option adds an include directive for the specified header at the beginning of the generated source file (preceding any other include directives). If GUARD is specified, the include directive is protected by the specified guard. For example, −−add−header precompiled.h,__PRECOMPILED_H__ results in the following directives at the beginning of the generated source file:

#ifndef __PRECOMPILED_H__
#define __PRECOMPILED_H__
#include <precompiled.h>
#endif

The option can be repeated to create include directives for several files. As suggested by the preceding example, this option is useful mainly to integrate the generated code with a compiler’s precompiled header mechanism.

−−impl

Generate sample implementation files. This option will not overwrite an existing file.

−−dll−export SYMBOL

Use SYMBOL to control DLL exports or imports. This option allows you to selectively export or import global symbols in the generated code. As an example, compiling a Slice definition with

$ slice2cpp −−dll−export ENABLE_DLL x.ice

results in the following additional code being generated into x.h:

#ifndef ENABLE_DLL
# ifdef ENABLE_DLL_EXPORTS
# define ENABLE_DLL ICE_DECLSPEC_EXPORT
# else
# define ENABLE_DLL ICE_DECLSPEC_IMPORT
# endif
#endif

ICE_DECLSPEC_EXPORT and ICE_DECLSPEC_IMPORT are platform- specific macros. For example, for Windows, they are defined as __declspec(dllexport) and __declspec(dllimport), respectively; for Solaris using CC version 5.5 or later, ICE_DECLSPEC_EXPORT is defined as __global, and ICE_DECLSPEC_IMPORT is empty.

The symbol name you specify on the command line (ENABLE_DLL in this example) is used by the generated code to export or import any symbols that must be visible to code outside the generated compilation unit. The net effect is that, if you want to create a DLL that includes x.cpp, but also want to use the generated types in compilation units outside the DLL, you can arrange for the relevant symbols to be exported by compiling x.cpp with -DENABLE_DLL_EXPORTS.

COPYRIGHT

Copyright (C) 2003-2006 ZeroC, Inc.

This is free software distributed under the GNU GPL. See /usr/share/doc/slice2cppe/copyright for specific conditions.

SEE ALSO

Further information is available in the book Distributed Programming with Ice by Michi Henning, Mark Spruiell, et al. available as a PDF file in non-free package zeroc−ice−manual.

pdf