• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.14
  • kdeedu
  • kig
  • objects
object_type_factory.cc
Go to the documentation of this file.
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
2 
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #include "object_type_factory.h"
19 
20 #include <config-kig.h>
21 
22 #include "object_type.h"
23 #include "circle_type.h"
24 #include "conic_types.h"
25 #include "cubic_type.h"
26 #include "intersection_types.h"
27 #include "line_type.h"
28 #include "text_type.h"
29 #include "other_type.h"
30 #include "transform_types.h"
31 #include "point_type.h"
32 #include "tests_type.h"
33 
34 #ifdef KIG_ENABLE_PYTHON_SCRIPTING
35 #include "../scripting/python_type.h"
36 #endif
37 
38 #include <qdom.h>
39 #include <string>
40 
41 ObjectTypeFactory::ObjectTypeFactory()
42  : malreadysetup( false )
43 {
44 }
45 
46 ObjectTypeFactory::~ObjectTypeFactory()
47 {
48 }
49 
50 ObjectTypeFactory* ObjectTypeFactory::instance()
51 {
52  static ObjectTypeFactory fact;
53  return &fact;
54 }
55 
56 void ObjectTypeFactory::add( const ObjectType* type )
57 {
58  assert( mmap.find( std::string( type->fullName() ) ) == mmap.end() );
59  mmap[std::string( type->fullName() )] = type;
60 }
61 
62 const ObjectType* ObjectTypeFactory::find( const char* name ) const
63 {
64  maptype::const_iterator i = mmap.find( std::string( name ) );
65  if ( i == mmap.end() ) return 0;
66  else return i->second;
67 }
68 
69 
circle_type.h
ObjectTypeFactory::add
void add(const ObjectType *type)
Definition: object_type_factory.cc:56
tests_type.h
cubic_type.h
point_type.h
object_type.h
line_type.h
object_type_factory.h
ObjectTypeFactory::instance
static ObjectTypeFactory * instance()
Definition: object_type_factory.cc:50
transform_types.h
other_type.h
ObjectTypeFactory
Definition: object_type_factory.h:26
ObjectType
The ObjectType class is a thing that represents the "behaviour" for a certain type.
Definition: object_type.h:32
intersection_types.h
text_type.h
conic_types.h
ObjectType::fullName
const char * fullName() const
Definition: object_type.cc:31
ObjectTypeFactory::find
const ObjectType * find(const char *name) const
Definition: object_type_factory.cc:62
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:05 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal