About CPP

  Search Here
Searching XAP 6.0 Documentation

                                               

Overview

The GigaSpaces C++ interface is based on a C++ projection of the JavaSpaces API. C++ applications can access the space directly using the projected versions of the regular JavaSpaces methods. Objects must be wrapped using the C++ projection of the ExternalEntry class (com::j_spaces::core::client::ExternalEntry; see C++ API Documentation). The C++ package is located at <GigaSpaces Root>/CPP.

Working with Projected Classes

Please note the following when working with GigaSpaces classes projected to C++:

  • Package names – in the package filenames of Java classes projected to C++, periods change into underscores. For example, the Java package name com.j_spaces.core.client.java becomes com_j_spaces_core_client_pkg.h when you project it into C++.
  • Namespaces – use normal C++ namespaces when referring to a projected class in the code. For example, to refer to the class SpaceFinder, enter com::j_spaces::core::client::SpaceFinder.
  • Objects returned by projected classes – C++ methods that are projections of static Java methods always return a generic Java object, regardless of the type of object stated in the header. To cast the object back into the original type, call the dyna_cast method from within the class the object belongs to (all projected C++ classes provide this method). Pass the object as an argument. The method returns the object cast into its original type.

Importing C++ Classes into GigaSpaces

According to the JavaSpaces specification, only Entries can be written to and read from a space. To write C++ objects to a space, you must use the ExternalEntry wrapper, which stores the meta data of a class in a JavaSpaces-compatible format. You can then write this wrapper to the space (see [Using ExternalEntry - 6.0] for more details).

You must use the C++ projection of the ExternalEntry class (com::j_spaces::core::client::ExternalEntry; see C++ API Documentation). A JavaSpaces-compatible wrapper is returned to you transparently. You can then call the C++ projection of the Write() method, passing xe (external entry) and the wrapped object as arguments.


GigaSpaces 6.0 Documentation Contents (Current Page in Bold)

    Java

    C++

    .NET

    Middleware Capabilities

    Configuration and Management

Add GigaSpaces wiki search to your browser search engines!
(works on Firefox 2 and Internet Explorer 7)

Labels

 
(None)