Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TransformXML.cxx

Go to the documentation of this file.
00001 /*
00002  * HippoPlot TransformXML implementation
00003  *
00004  * Copyright (C) 2002, 2003   The Board of Trustees of The Leland
00005  * Stanford Junior University.  All Rights Reserved.
00006  *
00007  * $Id: TransformXML.cxx,v 1.7 2003/02/17 18:16:43 pfkeb Exp $
00008  *
00009  */
00010 
00011 // for truncation warning
00012 #ifdef _MSC_VER
00013 #include "msdevstudio/MSconfig.h"
00014 #endif
00015 
00016 #include "TransformXML.h"
00017 
00018 #include "XmlElement.h"
00019 
00020 #include "transforms/TransformBase.h"
00021 #include "transforms/TransformFactory.h"
00022 
00023 #include <cassert>
00024 
00025 using std::string;
00026 
00027 TransformXML::TransformXML ( XmlController * controller )
00028   : BaseXML ( "Transform", controller )
00029 {
00030 }
00031 
00032 XmlElement * TransformXML::createElement ( const TransformBase & transform )
00033 {
00034   XmlElement * tag = BaseXML::createElement ();
00035   const string & type = transform.name();
00036   tag->setAttribute ( m_type, type );
00037 
00038   return tag;
00039 }
00040 
00041 TransformBase * TransformXML::createObject ( const XmlElement * element )
00042 {
00043   string type;
00044   bool ok = element->attribute ( m_type, type );
00045   assert ( ok );
00046 
00047   TransformFactory * factory = TransformFactory::instance ();
00048   TransformBase * transform = factory->createTransform ( type );
00049 
00050   return transform;
00051 }

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3