OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
Edit Class Reference

This class contains all data for the sequence editor. More...

#include <Edit.h>

Collaboration diagram for Edit:
Collaboration graph
[legend]

Public Types

typedef Sequence::TLine TLine
 The type of line contained in a sequence. More...
 
typedef Sequence::TLine::iterator iterator
 The line iterator for a sequence. More...
 

Public Member Functions

 Edit (Sequence *)
 Constructor. More...
 
 ~Edit ()
 
bool cycle (const PlaceRep &start)
 Cycle the edit sequence. More...
 
void finish (const std::string &newName)
 Finish editing. More...
 
void flatten ()
 Flatten the edit sequence. More...
 
int installMultiple (ElementBase *, double)
 Install multiple elements. More...
 
int installSingle (const PlaceRep &, ElementBase *, double)
 Install element relative to place. More...
 
int moveMultiple (double by)
 Move multiple elements. More...
 
int moveSingleAbs (const PlaceRep &, double to)
 Move single element. More...
 
int moveSingleRel (const PlaceRep &, const PlaceRep &, double to)
 Move single element. More...
 
void reflect ()
 Reflect the edit sequence. More...
 
int removeMultiple ()
 Remove multiple elements. More...
 
int removeSingle (const PlaceRep &)
 Remove single element. More...
 
int replaceMultiple (ElementBase *elem)
 Replace multiple elements. More...
 
int replaceSingle (const PlaceRep &, ElementBase *elem)
 Replace single element. More...
 
int select (const RangeRep &rng, const std::string &cls, const std::string &typ, const std::string &patt)
 Select elements in the edit sequence. More...
 
void selectClear ()
 Clear all selection flags. More...
 
void selectFull ()
 Set all selection flags. More...
 

Public Attributes

Pointer< SequenceitsSequence
 The original sequence. More...
 
Pointer< TLineitsLine
 The edit sequence. More...
 
bool isModified
 Modify flag. More...
 
EditParser parser
 The parser used during a sequence edit. More...
 

Static Public Attributes

static Editblock = 0
 Pointer to the edit data. More...
 

Private Member Functions

 Edit ()
 
 Edit (const Edit &)
 
void operator= (const Edit &)
 
void install (TLine &, ElementBase *, double)
 
int installMultiple (bool, TLine &, ElementBase *, double)
 
int installSingle (bool, TLine &, PlaceRep &, ElementBase *, double)
 
void merge (TLine &, TLine &)
 
int moveMultiple (bool, TLine &, double by)
 
int moveSingleAbs (bool, TLine &, PlaceRep &, double to)
 
int moveSingleRel (bool, TLine &, PlaceRep &, PlaceRep &, double to)
 
TLinereflect (TLine &)
 
int removeMultiple (bool, TLine &)
 
int removeSingle (bool, TLine &, PlaceRep &)
 
int replaceMultiple (bool, TLine &, ElementBase *elem)
 
int replaceSingle (bool, TLine &, PlaceRep &, ElementBase *elem)
 
void invalidLine (const char msg[])
 
void invalidShare (const char msg[])
 

Detailed Description

This class contains all data for the sequence editor.

Definition at line 38 of file Edit.h.

Member Typedef Documentation

typedef Sequence::TLine::iterator Edit::iterator

The line iterator for a sequence.

Definition at line 53 of file Edit.h.

The type of line contained in a sequence.

Definition at line 50 of file Edit.h.

Constructor & Destructor Documentation

Edit::Edit ( Sequence seq)

Constructor.

Definition at line 152 of file Edit.cpp.

References Sequence::copy(), Sequence::fetchLine(), Object::getOpalName(), itsLine, and selectClear().

Here is the call graph for this function:

Edit::~Edit ( )

Definition at line 160 of file Edit.cpp.

Edit::Edit ( )
private
Edit::Edit ( const Edit )
private

Member Function Documentation

bool Edit::cycle ( const PlaceRep start)

Cycle the edit sequence.

Definition at line 164 of file Edit.cpp.

References PlaceRep::enter(), Sequence::getLength(), PlaceRep::isActive(), isModified, itsLine, itsSequence, and PlaceRep::leave().

Here is the call graph for this function:

void Edit::finish ( const std::string &  newName)
void Edit::flatten ( )

Flatten the edit sequence.

Definition at line 247 of file Edit.cpp.

References Sequence::addEndMarkers(), Sequence::getReference(), Sequence::insertDrifts(), isModified, itsLine, and itsSequence.

Referenced by EditFlatten::execute().

Here is the call graph for this function:

void Edit::install ( TLine newList,
ElementBase elm,
double  at 
)
private
int Edit::installMultiple ( ElementBase elm,
double  at 
)

Install multiple elements.

Definition at line 259 of file Edit.cpp.

References itsLine.

Referenced by EditInstall::execute(), and installMultiple().

int Edit::installMultiple ( bool  shared,
TLine bl,
ElementBase elm,
double  at 
)
private

Definition at line 360 of file Edit.cpp.

References install(), installMultiple(), invalidLine(), invalidShare(), ElementBase::isSharable(), merge(), ElementBase::removeWrappers(), and Options::warn.

Here is the call graph for this function:

int Edit::installSingle ( const PlaceRep pos,
ElementBase elm,
double  at 
)

Install element relative to place.

Definition at line 264 of file Edit.cpp.

References itsLine.

Referenced by EditInstall::execute().

int Edit::installSingle ( bool  shared,
TLine bl,
PlaceRep it,
ElementBase elm,
double  at 
)
private

Definition at line 398 of file Edit.cpp.

References PlaceRep::enter(), PlaceRep::isActive(), ElementBase::isSharable(), PlaceRep::leave(), ElementBase::removeWrappers(), and Options::warn.

Here is the call graph for this function:

void Edit::invalidLine ( const char  msg[])
private

Definition at line 825 of file Edit.cpp.

References endl(), and Options::warn.

Referenced by installMultiple(), moveMultiple(), moveSingleAbs(), removeMultiple(), removeSingle(), replaceMultiple(), and replaceSingle().

Here is the call graph for this function:

void Edit::invalidShare ( const char  msg[])
private

Definition at line 833 of file Edit.cpp.

References endl(), and Options::warn.

Referenced by installMultiple(), moveMultiple(), moveSingleAbs(), removeMultiple(), removeSingle(), replaceMultiple(), and replaceSingle().

Here is the call graph for this function:

void Edit::merge ( TLine bl,
TLine newList 
)
private

Definition at line 439 of file Edit.cpp.

References isModified.

Referenced by installMultiple(), moveMultiple(), and moveSingleAbs().

int Edit::moveMultiple ( double  by)

Move multiple elements.

Definition at line 270 of file Edit.cpp.

References itsLine.

Referenced by EditMove::execute(), and moveMultiple().

int Edit::moveMultiple ( bool  shared,
TLine bl,
double  by 
)
private

Definition at line 479 of file Edit.cpp.

References invalidLine(), invalidShare(), isModified, ElementBase::isSharable(), merge(), moveMultiple(), ElementBase::removeWrappers(), and Options::warn.

Here is the call graph for this function:

int Edit::moveSingleAbs ( const PlaceRep pos,
double  to 
)

Move single element.

Definition at line 275 of file Edit.cpp.

References itsLine.

Referenced by EditMove::execute(), and moveSingleAbs().

int Edit::moveSingleAbs ( bool  shared,
TLine bl,
PlaceRep it,
double  to 
)
private
int Edit::moveSingleRel ( const PlaceRep pos,
const PlaceRep from,
double  to 
)

Move single element.

Definition at line 281 of file Edit.cpp.

References itsLine.

Referenced by EditMove::execute().

int Edit::moveSingleRel ( bool  shared,
TLine bl,
PlaceRep it,
PlaceRep from,
double  to 
)
private
void Edit::operator= ( const Edit )
private
void Edit::reflect ( )

Reflect the edit sequence.

Definition at line 288 of file Edit.cpp.

References itsLine.

Referenced by EditReflect::execute().

Edit::TLine * Edit::reflect ( TLine bl)
private

Definition at line 630 of file Edit.cpp.

References ElementBase::getName(), FlaggedElmPtr::getReflectionFlag(), isModified, SequenceMember::itsPosition, and FlaggedElmPtr::setReflectionFlag().

Here is the call graph for this function:

int Edit::removeMultiple ( )

Remove multiple elements.

Definition at line 293 of file Edit.cpp.

References itsLine.

Referenced by EditRemove::execute(), and removeMultiple().

int Edit::removeMultiple ( bool  shared,
TLine bl 
)
private

Definition at line 652 of file Edit.cpp.

References invalidLine(), invalidShare(), isModified, ElementBase::isSharable(), removeMultiple(), ElementBase::removeWrappers(), and Options::warn.

Here is the call graph for this function:

int Edit::removeSingle ( const PlaceRep pos)

Remove single element.

Definition at line 298 of file Edit.cpp.

References itsLine.

Referenced by EditRemove::execute(), and removeSingle().

int Edit::removeSingle ( bool  shared,
TLine bl,
PlaceRep it 
)
private
int Edit::replaceMultiple ( ElementBase elem)

Replace multiple elements.

Definition at line 304 of file Edit.cpp.

References itsLine.

Referenced by EditReplace::execute(), and replaceMultiple().

int Edit::replaceMultiple ( bool  shared,
TLine bl,
ElementBase elem 
)
private
int Edit::replaceSingle ( const PlaceRep pos,
ElementBase elem 
)

Replace single element.

Definition at line 309 of file Edit.cpp.

References itsLine.

Referenced by EditReplace::execute(), and replaceSingle().

int Edit::replaceSingle ( bool  shared,
TLine bl,
PlaceRep it,
ElementBase elem 
)
private
int Edit::select ( const RangeRep rng,
const std::string &  cls,
const std::string &  typ,
const std::string &  patt 
)

Select elements in the edit sequence.

Definition at line 315 of file Edit.cpp.

References Selector::execute(), Selector::getCount(), and itsLine.

Referenced by EditSelect::execute().

Here is the call graph for this function:

void Edit::selectClear ( )

Clear all selection flags.

Definition at line 323 of file Edit.cpp.

References DefaultVisitor::execute(), and itsLine.

Referenced by Edit(), EditSelect::execute(), and finish().

Here is the call graph for this function:

void Edit::selectFull ( )

Set all selection flags.

Definition at line 329 of file Edit.cpp.

References DefaultVisitor::execute(), and itsLine.

Referenced by EditSelect::execute().

Here is the call graph for this function:

Member Data Documentation

Edit * Edit::block = 0
static
bool Edit::isModified
Pointer<TLine> Edit::itsLine
Pointer<Sequence> Edit::itsSequence

The original sequence.

Definition at line 121 of file Edit.h.

Referenced by cycle(), EditEnd::execute(), finish(), and flatten().

EditParser Edit::parser

The parser used during a sequence edit.

Definition at line 131 of file Edit.h.

Referenced by EditCmd::execute(), and EditEnd::execute().


The documentation for this class was generated from the following files: