util::FileObject Class Reference

This class is the base class for any object that might be watched by the WatchDog. More...

#include <util/watchdog.h>

Inheritance diagram for util::FileObject:
Inheritance graph
[legend]

List of all members.

Signals

void modified ()
 Signal emitted to indicate a change in the object.

Public Member Functions

 FileObject (const FileObject &copy, QObject *parent=0)
 Copy constructor.
 FileObject (QString fn, QObject *parent=0)
 Initialized constructor.
 FileObject (std::string fn, QObject *parent=0)
 Initialized constructor.
 FileObject (QObject *parent=0)
 Default constructor.
std::string getFilename ()
 Get the current filename of the object.
FileObjectoperator= (const FileObject &other)
 Assignment operator.
virtual void reread ()=0
 Method to be implemented in subblasses to reread the file.
void setFilename (const char *fn)
 Change the file handled.
void setFilename (QString fn)
 Change the file handled.
void setFilename (std::string fn)
 Change the file handled.
void update ()

Protected Attributes

std::string filename

Detailed Description

This class is the base class for any object that might be watched by the WatchDog.

Anytime the FileObject::update() method is called, the FileObject::modified() signal is emuitted by the object.

Definition at line 30 of file watchdog.h.


Constructor & Destructor Documentation

util::FileObject::FileObject ( QObject parent = 0  )  [inline]

Default constructor.

Just initialize the QObject.

Definition at line 40 of file watchdog.h.

00040 : QObject(parent) {}

util::FileObject::FileObject ( std::string  fn,
QObject parent = 0 
) [inline]

Initialized constructor.

Parameters:
fn Name of the file handled by this object

Definition at line 46 of file watchdog.h.

00046 : QObject(parent), filename(fn) {}

util::FileObject::FileObject ( QString  fn,
QObject parent = 0 
) [inline]

Initialized constructor.

Parameters:
fn Name of the file handled by this object

Definition at line 52 of file watchdog.h.

00052 : QObject(parent), filename(fn.toStdString()) {}

util::FileObject::FileObject ( const FileObject copy,
QObject parent = 0 
) [inline]

Copy constructor.

Parameters:
copy Object to copy

Definition at line 58 of file watchdog.h.

00058 : QObject(parent), filename(copy.filename) {}


Member Function Documentation

std::string util::FileObject::getFilename (  )  [inline]

Get the current filename of the object.

Definition at line 91 of file watchdog.h.

Referenced by util::WatchDog::addObject(), util::WatchDog::changeFilename(), util::WatchDog::removeObject(), and util::KeyFramer::reread().

00091 { return filename; }

void util::FileObject::modified (  )  [signal]

Signal emitted to indicate a change in the object.

FileObject& util::FileObject::operator= ( const FileObject other  )  [inline]

Assignment operator.

Parameters:
other Object to copy

If the object to copy handle a different filename, then the FileObject::modified() signal is emitted.

Definition at line 67 of file watchdog.h.

00068     { if(other.filename != filename) { filename = other.filename; } return *this; }

virtual void util::FileObject::reread (  )  [pure virtual]

Method to be implemented in subblasses to reread the file.

Implemented in Model, util::Contour, util::Function, util::KeyFramer, util::Materials, and util::Palette.

void util::FileObject::setFilename ( const char *  fn  )  [inline]

Change the file handled.

If the call actually change the file handled, then FileObject::modified() is emitted.

Definition at line 115 of file watchdog.h.

References setFilename().

Referenced by setFilename().

00115 { setFilename(std::string(fn)); }

void util::FileObject::setFilename ( QString  fn  )  [inline]

Change the file handled.

If the call actually change the file handled, then FileObject::modified() is emitted.

Definition at line 107 of file watchdog.h.

References setFilename().

Referenced by setFilename().

00107 { setFilename(fn.toStdString()); }

void util::FileObject::setFilename ( std::string  fn  ) 

Change the file handled.

If the call actually change the file handled, then FileObject::modified() is emitted.

Definition at line 15 of file watchdog.cpp.

Referenced by util::WatchDog::changeFilename().

00016   {
00017     if(fn != filename)
00018     {
00019       filename = fn;
00020       if(!fn.empty())
00021         update();
00022     }
00023   }


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:28 2013 for VVE by  doxygen 1.6.3