object.cc

Go to the documentation of this file.
00001 /*
00002    The lestes compiler suite
00003    Copyright (C) 2002, 2003, 2004, 2005 Miroslav Tichy
00004    Copyright (C) 2002, 2003, 2004, 2005 Petr Zika
00005    Copyright (C) 2002, 2003, 2004, 2005 Vojtech Hala
00006    Copyright (C) 2002, 2003, 2004, 2005 Jiri Kosina
00007    Copyright (C) 2002, 2003, 2004, 2005 Pavel Sanda
00008    Copyright (C) 2002, 2003, 2004, 2005 Jan Zouhar
00009    Copyright (C) 2002, 2003, 2004, 2005 Rudolf Thomas
00010 
00011    This program is free software; you can redistribute it and/or modify
00012    it under the terms of the GNU General Public License as published by
00013    the Free Software Foundation; version 2 of the License.
00014 
00015    This program is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018    GNU General Public License for more details.
00019 
00020    See the full text of the GNU General Public License version 2, and
00021    the limitations in the file doc/LICENSE.
00022 
00023    By accepting the license the licensee waives any and all claims
00024    against the copyright holder(s) related in whole or in part to the
00025    work, its use, and/or the inability to use it.
00026  
00027  */
00028 /*! \file
00029   Definition of object class representing general object.
00030   \author pt
00031   \author rudo, the dumper code
00032 */
00033 #include <lestes/common.hh>
00034 #include <lestes/std/object.hh>
00035 #include <lestes/std/reflect.hh>
00036 #include <lestes/std/list.hh>
00037 #include <lestes/std/pair.hh>
00038 #include <lestes/std/dumper_visitor.hh>
00039 
00040 package(lestes);
00041 package(std);
00042 
00043 ptr<object::reflection_list> object::reflection;
00044 
00045 ptr<object::reflection_list> object::reflection_get() const
00046 {
00047         if (!reflection) {
00048                 reflection = reflection_list::create();
00049                 reflection->push_back(
00050                         class_reflection::create( "object",
00051                                 class_reflection::field_metadata_list::create() ) );
00052         }
00053         return reflection;
00054 }
00055 
00056 ptr<object::field_list_list> object::field_values_get() const
00057 {
00058         return field_list_list::create();
00059 }
00060 
00061 void object::accept_dumper_visitor( ptr<dumper_visitor> v )
00062 {
00063         return v->visit_object(this);
00064 }
00065 
00066 ulint object::next_uid = 1;
00067 
00068 ulint object::uid_get()
00069 {
00070         if (uid == 0)
00071                 uid = next_uid++;
00072         return uid;
00073 }
00074 
00075 bool object::dump_barrier_get() const
00076 {
00077         return dump_barrier;
00078 }
00079 
00080 void object::dump_barrier_set( bool b )
00081 {
00082         dump_barrier = b;
00083 }
00084 
00085 /*!
00086  * The comparision is done by comparing the object to be the same entity.
00087  * \author TMA
00088  */
00089 bool object::equals(ptr <object> o)
00090 {
00091         return o == this;
00092 }
00093 end_package(std);
00094 end_package(lestes);
00095 
00096 /* vim: set ft=lestes : */

Generated on Mon Feb 12 18:22:42 2007 for lestes by doxygen 1.5.1-20070107