"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/src/include/Diluculum/CppObject.hpp" (12 May 2020, 2780 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /******************************************************************************\
    2 * CppObject.hpp                                                                *
    3 * A struct stored as Lua userdata when exporting or instantiating objects.     *
    4 *                                                                              *
    5 *                                                                              *
    6 * Copyright (C) 2005-2013 by Leandro Motta Barros.                             *
    7 *                                                                              *
    8 * Permission is hereby granted, free of charge, to any person obtaining a copy *
    9 * of this software and associated documentation files (the "Software"), to     *
   10 * deal in the Software without restriction, including without limitation the   *
   11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or  *
   12 * sell copies of the Software, and to permit persons to whom the Software is   *
   13 * furnished to do so, subject to the following conditions:                     *
   14 *                                                                              *
   15 * The above copyright notice and this permission notice shall be included in   *
   16 * all copies or substantial portions of the Software.                          *
   17 *                                                                              *
   18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR   *
   19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,     *
   20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE *
   21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER       *
   22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      *
   23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS *
   24 * IN THE SOFTWARE.                                                             *
   25 \******************************************************************************/
   26 
   27 
   28 #ifndef _DILUCULUM_CPP_OBJECT_HPP_
   29 #define _DILUCULUM_CPP_OBJECT_HPP_
   30 
   31 namespace Diluculum
   32 {
   33    namespace Impl
   34    {
   35       /** The data that is stored as userdata when a C++ object is exported to
   36        *  or instantiated in Lua.
   37        */
   38       struct CppObject
   39       {
   40          public:
   41             /// Pointer to the actual object.
   42             void* ptr;
   43 
   44             /** Should the \c ptr be <tt>delete</tt>d when the userdata is
   45              *  garbage-collected in Lua? Essentially, if the object is
   46              *  instantiated in Lua, it should be; if it is instantiated in C++,
   47              *  it doesn't.
   48              */
   49             bool deleteMe;
   50       };
   51 
   52    } // namespace Impl
   53 
   54 } // namespace Diluculum
   55 
   56 #endif // _DILUCULUM_CPP_OBJECT_HPP_