Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

LCD_DocumentImpl Class Reference

#include <LCD_DocumentImpl.hh>

Inheritance diagram for LCD_DocumentImpl:

Inheritance graph
[legend]
Collaboration diagram for LCD_DocumentImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void registerListener (LCD_DocListener *ls)
int deleteListener (LCD_DocListener *ls)
void notifyListeners ()
XERCES_CPP_NAMESPACE::DOM_Element getElement (XERCES_CPP_NAMESPACE::DOMString id, XERCES_CPP_NAMESPACE::DOMString elementName=XERCES_CPP_NAMESPACE::DOMString("*")) const

Private Member Functions

 LCD_DocumentImpl (std::string XMLfilespec)
void parse ()

Private Attributes

std::string filespec
std::list< LCD_DocListener * > * listeners
Timestamp firstRead
Timestamp lastMod
XERCES_CPP_NAMESPACE::DOMParser * parser
LCD_DocErrorReportererrReporter

Friends

class LCD_DocManager

Constructor & Destructor Documentation

XERCES_CPP_NAMESPACE_USE LCD_DocumentImpl::LCD_DocumentImpl std::string  XMLfilespec  )  [private]
 

Definition at line 61 of file LCD_DocumentImpl.cc.

References errReporter, filespec, listeners, and parser.

00061                                                         {
00062   // This method should only be invoked by the  LCD_DocManager
00063   DOM_Element elt;
00064 
00065   errReporter = new LCD_DocErrorReporter();
00066 
00067   parser = new DOMParser();
00068   parser->setErrorHandler(errReporter);
00069 
00070   listeners = new std::list<LCD_DocListener*>;
00071   filespec = XMLfilespec;
00072 }


Member Function Documentation

int LCD_DocumentImpl::deleteListener LCD_DocListener ls  )  [virtual]
 

Implements LCD_Document.

Definition at line 151 of file LCD_DocumentImpl.cc.

References listeners.

00151                                                         {
00152 
00153   std::list<LCD_DocListener*>::iterator
00154     which = std::find(listeners->begin(), listeners->end(), ls);
00155   if (which != listeners->end()) {
00156 
00157     // delete it from list
00158     listeners->erase(which);
00159   }
00160   else {
00161     return 1;  // not found
00162   }
00163   return 0;
00164 }

XERCES_CPP_NAMESPACE::DOM_Element LCD_DocumentImpl::getElement XERCES_CPP_NAMESPACE::DOMString  id,
XERCES_CPP_NAMESPACE::DOMString  elementName = XERCES_CPP_NAMESPACE::DOMString("*")
const [virtual]
 

Implements LCD_Document.

void LCD_DocumentImpl::notifyListeners  )  [virtual]
 

Implements LCD_Document.

Definition at line 171 of file LCD_DocumentImpl.cc.

00171                                        {
00172   // fetch listeners; invoke handler for each
00173   return;
00174 }

void LCD_DocumentImpl::parse  )  [private]
 

Definition at line 79 of file LCD_DocumentImpl.cc.

References LCD_Document::descrip, LCD_Document::docTypeName, filespec, firstRead, LCD_Document::myDoc, and parser.

Referenced by LCD_DocManager::makeDocument().

00079                              {
00080 
00081   // static const DOMString& descripString = DOMString("descrip");
00082   const DOMString& descripString = DOMString("descrip");
00083   DOM_Element elt;
00084 
00085   parser->parse(filespec.c_str());
00086   myDoc = parser->getDocument();
00087 
00088   //  firstRead = getCurrentTime();     to be defined
00089   firstRead = 0;
00090 
00091   elt = myDoc.getDocumentElement();
00092 
00093   // dtd doctype name must match tag name of root element of doc
00094   docTypeName = elt.getTagName();
00095 
00096   descrip = elt.getAttribute(descripString);
00097 
00098 }

void LCD_DocumentImpl::registerListener LCD_DocListener ls  )  [virtual]
 

Implements LCD_Document.

Definition at line 144 of file LCD_DocumentImpl.cc.

References listeners.

00144                                                            {
00145   listeners->push_front(ls);
00146 }


Friends And Related Function Documentation

friend class LCD_DocManager [friend]
 

Definition at line 39 of file LCD_DocumentImpl.hh.


Member Data Documentation

LCD_DocErrorReporter* LCD_DocumentImpl::errReporter [private]
 

Definition at line 56 of file LCD_DocumentImpl.hh.

Referenced by LCD_DocumentImpl(), and LCD_DocManager::makeDocument().

std::string LCD_DocumentImpl::filespec [private]
 

Definition at line 49 of file LCD_DocumentImpl.hh.

Referenced by LCD_DocumentImpl(), and parse().

Timestamp LCD_DocumentImpl::firstRead [private]
 

Definition at line 52 of file LCD_DocumentImpl.hh.

Referenced by parse().

Timestamp LCD_DocumentImpl::lastMod [private]
 

Definition at line 53 of file LCD_DocumentImpl.hh.

std::list<LCD_DocListener*>* LCD_DocumentImpl::listeners [private]
 

Definition at line 50 of file LCD_DocumentImpl.hh.

Referenced by deleteListener(), LCD_DocumentImpl(), and registerListener().

XERCES_CPP_NAMESPACE::DOMParser* LCD_DocumentImpl::parser [private]
 

Definition at line 55 of file LCD_DocumentImpl.hh.

Referenced by LCD_DocumentImpl(), and parse().


The documentation for this class was generated from the following files:
Generated on Thu Oct 7 18:45:04 2004 for LCDG4 by doxygen 1.3.4