1 ///@file Object exposed to Nasal including a Nasal hash for data storage.
3 // Copyright (C) 2014 Thomas Geymayer <tomgey@gmail.com>
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Library General Public
7 // License as published by the Free Software Foundation; either
8 // version 2 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Library General Public License for more details.
15 // You should have received a copy of the GNU Library General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef SG_NASAL_OBJECT_HXX_
20 #define SG_NASAL_OBJECT_HXX_
22 #include "NasalObjectHolder.hxx"
28 public virtual SGVirtualWeakReferenced
34 * @param impl Initial implementation hash (nasal part of
37 Object(naRef impl = naNil());
39 void setImpl(naRef obj);
40 naRef getImpl() const;
42 bool _set(naContext c, const std::string& key, naRef val);
43 bool _get(naContext c, const std::string& key, naRef& out);
45 static void setupGhost();
48 ObjectHolder<> _nasal_impl;
52 typedef SGSharedPtr<Object> ObjectRef;
53 typedef SGWeakPtr<Object> ObjectWeakRef;
54 typedef Ghost<ObjectRef> NasalObject;
58 #endif /* SG_NASAL_OBJECT_HXX_ */