|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PList.h>
Public Member Functions | |
| PList () | |
| Standard Constructor. | |
| PList (int reservedsize) | |
| virtual | ~PList () |
| Standard Destructor. | |
| PList (const PList &tmpList) | |
| Copy Constructor. | |
| virtual PList * | Clone () |
| Makes and returns a deep copy–notworking because copy makes deep copy anyway? | |
| std::vector< Variant >::const_iterator | Begin () const |
| std::vector< Variant >::const_iterator | End () const |
| std::vector< Variant >::iterator | Begin () |
| std::vector< Variant >::iterator | End () |
| void | PushBack (const Variant &v) |
| void | PopBack () |
| bool | IsEmpty () |
| void | Clear () |
| Variant | First () |
| Variant | Rest () |
| Variant | Nth (unsigned int n) |
| Variant | Last () |
| counted_ptr< PEBLObjectBase > | SortBy (const PList &key) |
| unsigned long | Length () const |
| bool | IsMember (Variant v) |
| void | SetElement (unsigned int n, Variant value) |
| const std::vector< Variant > * | GetList () const |
Public Member Functions inherited from PEBLObjectBase | |
| PEBLObjectBase () | |
| Standard Constructor. | |
| PEBLObjectBase (ComplexDataType cdt) | |
| Standard Constructor. | |
| PEBLObjectBase (const PEBLObjectBase &pob) | |
| virtual | ~PEBLObjectBase () |
| Standard Destructor. | |
| virtual bool | InitializeProperty (std::string name, Variant v) |
| virtual bool | SetProperty (std::string name, Variant v) |
| Variant | GetProperty (std::string) const |
| virtual ObjectValidationError | ValidateProperty (std::string, Variant v) const |
| virtual ObjectValidationError | ValidateProperty (std::string) const |
| ComplexDataType | GetType () |
| virtual std::string | ObjectName () const |
| virtual std::ostream & | PrintProperties (std::ostream &out) |
| virtual Variant | GetPropertyList () |
Protected Member Functions | |
| std::ostream & | SendToStream (std::ostream &out) const |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const PList &pcd) |
Additional Inherited Members | |
Protected Attributes inherited from PEBLObjectBase | |
| ComplexDataType | mCDT |
| std::map< std::string, Variant > | mProperties |
This class is a simple list of Variants. It is implemented as an STL list, but does not currently expose all of the STL list methods.
| PList::PList | ( | ) |
| PList::PList | ( | int | reservedsize | ) |
|
virtual |
| PList::PList | ( | const PList & | tmpList | ) |
Copy Constructor.
Copy constructor. Should make a deep copy.
Defunct code attempt: Using STL copy algorithm
Definition at line 63 of file PList.cpp.
References GetList().
| std::vector< Variant >::iterator PList::Begin | ( | ) |
| std::vector< Variant >::const_iterator PList::Begin | ( | ) | const |
Definition at line 127 of file PList.cpp.
Referenced by PEBLList::Append(), PEBLEnvironment::CallFunction(), PEBLList::CrossFactorWithoutDuplicates(), PEBLList::DesignFullCounterbalance(), PlatformPolygon::Draw(), PlatformBezier::Draw(), Evaluator::Evaluate(), Evaluator::Evaluate1(), PEBLList::IsMember(), PEBLList::ListToString(), PEBLList::Merge(), PEBLList::ModList(), PEBLMath::Recurse(), PEBLMath::Recurse2(), PEBLList::RepeatList(), PEBLList::Rotate(), SortBy(), PEBLList::SubList(), PEBLList::Transpose(), PEBLEnvironment::WaitForKeyListDown(), PEBLEnvironment::WaitForListKeyPress(), and PEBLEnvironment::WaitForListKeyPressWithTimeout().
|
virtual |
Makes and returns a deep copy–notworking because copy makes deep copy anyway?
Cloner. This makes a item-for-item deep copy and returns a pointer to it.
Defunct code attempt: Using STL copy algorithm
Definition at line 86 of file PList.cpp.
References PList().
| std::vector< Variant >::iterator PList::End | ( | ) |
| std::vector< Variant >::const_iterator PList::End | ( | ) | const |
Definition at line 132 of file PList.cpp.
Referenced by PEBLList::Append(), PEBLEnvironment::CallFunction(), PEBLList::CrossFactorWithoutDuplicates(), PEBLList::DesignFullCounterbalance(), PlatformPolygon::Draw(), PlatformBezier::Draw(), Evaluator::Evaluate(), Evaluator::Evaluate1(), PEBLList::IsMember(), PEBLList::ListToString(), PEBLList::Merge(), PEBLList::ModList(), PEBLMath::Recurse(), PEBLMath::Recurse2(), PEBLList::RepeatList(), PEBLList::Rotate(), SortBy(), PEBLList::SubList(), PEBLEnvironment::WaitForKeyListDown(), PEBLEnvironment::WaitForListKeyPress(), and PEBLEnvironment::WaitForListKeyPressWithTimeout().
| Variant PList::First | ( | ) |
Definition at line 169 of file PList.cpp.
References PError::SignalFatalError().
Referenced by PEBLMath::Abs(), PEBLMath::AbsFloor(), PEBLMath::ACos(), PEBLObjects::AddObject(), PEBLList::Append(), PEBLStream::AppendFile(), PEBLMath::ASin(), PEBLMath::ATan(), PEBLObjects::Bezier(), Evaluator::CallFunction(), PEBLEnvironment::CallFunction(), PEBLMath::Ceiling(), PEBLEnvironment::CheckProcessStatus(), PEBLObjects::Circle(), PEBLStream::CopyFile(), PEBLEnvironment::CopyToClipboard(), PEBLString::CopyToClipboard(), PEBLMath::Cos(), PEBLList::CrossFactorWithoutDuplicates(), PEBLMath::DegToRad(), PEBLEnvironment::DeleteFile(), PEBLList::DesignFullCounterbalance(), PEBLString::DetectTextScript(), PEBLObjects::Draw(), PEBLObjects::DrawFor(), PEBLObjects::Ellipse(), PEBLStream::EndOfFile(), PEBLStream::EndOfLine(), Evaluator::Evaluate1(), PEBLEnvironment::ExitQuietly(), PEBLMath::Exp(), PEBLList::Fifth(), PEBLStream::FileClose(), PEBLEnvironment::FileExists(), PEBLStream::FileOpenAppend(), PEBLStream::FileOpenOverwrite(), PEBLStream::FileOpenRead(), PEBLStream::FileOpenWrite(), PEBLStream::FilePrint(), PEBLStream::FilePrint_(), PEBLStream::FileReadCharacter(), PEBLStream::FileReadLine(), PEBLStream::FileReadList(), PEBLStream::FileReadTable(), PEBLStream::FileReadText(), PEBLStream::FileReadWord(), PEBLString::FindInString(), PEBLList::First(), PEBLMath::Floor(), PEBLStream::Format(), PEBLList::Fourth(), PEBLObjects::GetAudioStats(), PEBLObjects::GetCursorPosition(), PEBLEnvironment::GetDirectoryListing(), PEBLObjects::GetEyeObject(), PEBLString::GetFontForText(), PEBLEnvironment::GetInput0(), PEBLEnvironment::GetJoystick(), PEBLEnvironment::GetJoystickAxisState(), PEBLEnvironment::GetJoystickBallState(), PEBLEnvironment::GetJoystickButtonState(), PEBLEnvironment::GetJoystickHatState(), PEBLObjects::GetLineBreaks(), PEBLEnvironment::GetNumJoystickAxes(), PEBLEnvironment::GetNumJoystickBalls(), PEBLEnvironment::GetNumJoystickButtons(), PEBLEnvironment::GetNumJoystickHats(), PEBLEnvironment::GetObjectTime(), PEBLObjects::GetParent(), PEBLObjects::GetPixelColor(), PEBLObjects::GetProperty(), PEBLObjects::GetPropertyList(), PEBLObjects::GetSize(), PEBLObjects::GetText(), PEBLEnvironment::GetTextBoxCursorFromClick(), PEBLEnvironment::GetVideoModes(), PEBLObjects::GetVocalResponseTime(), PEBLObjects::Hide(), PEBLEnvironment::IsAudioOut(), PEBLEnvironment::IsCanvas(), PEBLEnvironment::IsColor(), PEBLEnvironment::IsCustomObject(), PEBLEnvironment::IsDirectory(), PEBLEnvironment::IsFileStream(), PEBLEnvironment::IsFloat(), PEBLEnvironment::IsFont(), PEBLEnvironment::IsImage(), PEBLEnvironment::IsInteger(), PEBLEnvironment::IsJoystick(), PEBLEnvironment::IsKeyDown(), PEBLEnvironment::IsKeyUp(), PEBLEnvironment::IsLabel(), PEBLEnvironment::IsList(), PEBLList::IsMember(), PEBLEnvironment::IsNumber(), PEBLEnvironment::IsPEBLObject(), PEBLString::IsRTL(), PEBLEnvironment::IsShape(), PEBLEnvironment::IsString(), PEBLEnvironment::IsText(), PEBLEnvironment::IsTextBox(), PEBLEnvironment::IsWidget(), PEBLEnvironment::IsWindow(), PEBLList::Last(), PEBLEnvironment::LaunchFile(), PEBLList::Length(), PEBLObjects::Line(), PEBLList::ListToString(), PEBLMath::Ln(), PEBLObjects::LoadAudioFile(), PEBLObjects::LoadMovie(), PEBLObjects::LoadSound(), PEBLMath::Log10(), PEBLMath::Log2(), PEBLMath::LogN(), PEBLString::Lowercase(), PEBLObjects::MakeAudioInputBuffer(), PEBLObjects::MakeCanvas(), PEBLObjects::MakeColor(), PEBLObjects::MakeColorRGB(), PEBLObjects::MakeCustomObject(), PEBLEnvironment::MakeDirectory(), PEBLObjects::MakeFont(), PEBLObjects::MakeImage(), PEBLObjects::MakeLabel(), PEBLObjects::MakeSineWave(), PEBLObjects::MakeTextBox(), PEBLObjects::MakeWindow(), PEBLStream::MD5File(), PEBLStream::MD5Sum(), PEBLList::Merge(), PEBLMath::Mod(), PEBLList::ModList(), PEBLObjects::Move(), PEBLList::Nth(), PEBLMath::NthRoot(), PEBLStream::ParseJSON(), PEBLObjects::PausePlayback(), PEBLInterpret(), PEBLObjects::PlayBackground(), PEBLObjects::PlayForeground(), PEBLEnvironment::PlayMovie(), PEBLObjects::Polygon(), PEBLMath::Pow(), PEBLStream::Print(), PEBLStream::Print_(), PEBLObjects::PrintProperties(), PEBLObjects::PropertyExists(), PEBLList::PushOnEnd(), PEBLMath::RadToDeg(), PEBLMath::RandomBernoulli(), PEBLMath::RandomBinomial(), PEBLMath::RandomDiscrete(), PEBLMath::RandomExponential(), PEBLMath::RandomLogNormal(), PEBLMath::RandomNormal(), PEBLMath::RandomUniform(), PEBLObjects::RecordToBuffer(), PEBLObjects::Rectangle(), PEBLString::RegexMatch(), PEBLEnvironment::RegisterEvent(), PEBLObjects::RemoveObject(), PEBLList::Repeat(), PEBLList::RepeatList(), PEBLObjects::ResizeWindow(), PEBLList::Rotate(), PEBLObjects::RotoZoom(), PEBLMath::Round(), PEBLObjects::SaveAudioToWaveFile(), PEBLList::Second(), PEBLMath::SeedRNG(), PEBLList::Sequence(), PEBLEnvironment::SetCursorPosition(), PEBLObjects::SetCursorPosition(), PEBLObjects::SetEditable(), PEBLList::SetElement(), PEBLObjects::SetEyeTrackerHandler(), PEBLObjects::SetFont(), PEBLObjects::SetPanning(), PEBLObjects::SetPlayRepeats(), PEBLObjects::SetPoint(), PEBLObjects::SetProperty(), PEBLObjects::SetText(), PEBLEnvironment::SetWorkingDirectory(), PEBLObjects::Show(), PEBLEnvironment::ShowCursor(), PEBLList::Shuffle(), PEBLMath::Sign(), PEBLEnvironment::SignalFatalError(), PEBLMath::Sin(), PEBLList::Sort(), PEBLList::SortBy(), PEBLString::SplitString(), PEBLMath::Sqrt(), PEBLObjects::Square(), PEBLObjects::StartAudioMonitor(), PEBLObjects::StartPlayback(), PEBLObjects::Stop(), PEBLObjects::StopAudioMonitor(), PEBLString::StringLength(), PEBLList::SubList(), PEBLString::SubString(), PEBLEnvironment::SystemCall(), PEBLMath::Tan(), PEBLObjects::ThickLine(), PEBLList::Third(), PEBLString::ToASCII(), PEBLMath::ToFloat(), PEBLMath::ToInt(), PEBLMath::ToNumber(), PEBLMath::ToString(), PEBLEnvironment::TranslateKeyCode(), PEBLEnvironment::TranslateString(), PEBLList::Transpose(), PEBLString::Uppercase(), PEBLEnvironment::VariableExists(), PEBLEnvironment::Wait(), PEBLEnvironment::WaitForAnyKeyDownWithTimeout(), PEBLEnvironment::WaitForAnyKeyPressWithTimeout(), PEBLEnvironment::WaitForKeyDown(), PEBLEnvironment::WaitForKeyListDown(), PEBLEnvironment::WaitForKeyPress(), PEBLEnvironment::WaitForKeyRelease(), PEBLEnvironment::WaitForKeyUp(), PEBLEnvironment::WaitForListKeyPress(), PEBLEnvironment::WaitForListKeyPressWithTimeout(), PEBLEnvironment::WaitForMouseButtonWithTimeout(), and PEBLStream::WritePNG().
|
inline |
| bool PList::IsMember | ( | Variant | v | ) |
| Variant PList::Last | ( | ) |
Definition at line 235 of file PList.cpp.
References PError::SignalFatalError().
Referenced by PEBLList::Last().
|
inline |
Definition at line 89 of file PList.h.
Referenced by PlatformPolygon::Draw(), PlatformBezier::Draw(), Evaluator::Evaluate(), Evaluator::Evaluate1(), PEBLEnvironment::ExitQuietly(), PEBLStream::FileReadTable(), PEBLString::GetFontForText(), PEBLEnvironment::GetInput0(), PEBLList::Length(), PEBLList::ListToString(), PEBLObjects::MakeCanvas(), PEBLObjects::MakeWindow(), PEBLList::ModList(), PEBLInterpret(), PEBLObjects::RecordToBuffer(), PEBLList::Rotate(), PEBLMath::Round(), PEBLList::Shuffle(), PEBLList::SubList(), PEBLEnvironment::SystemCall(), PEBLEnvironment::SystemCallUpdate(), PEBLList::Transpose(), and PEBLStream::WritePNG().
| Variant PList::Nth | ( | unsigned int | n | ) |
Definition at line 181 of file PList.cpp.
References PError::SignalFatalError().
Referenced by PEBLObjects::AddObject(), PEBLList::Append(), PEBLStream::AppendFile(), PEBLObjects::Bezier(), PEBLEnvironment::CallFunction(), PEBLObjects::Circle(), PEBLStream::CopyFile(), PEBLList::DesignFullCounterbalance(), PEBLObjects::DrawFor(), PEBLObjects::Ellipse(), Evaluator::Evaluate1(), PEBLEnvironment::ExitQuietly(), PEBLList::Fifth(), PEBLStream::FilePrint(), PEBLStream::FilePrint_(), PEBLStream::FileReadTable(), PEBLString::FindInString(), PEBLList::Fourth(), PEBLObjects::GetAudioStats(), PEBLString::GetFontForText(), PEBLEnvironment::GetInput0(), PEBLEnvironment::GetJoystickAxisState(), PEBLEnvironment::GetJoystickBallState(), PEBLEnvironment::GetJoystickButtonState(), PEBLEnvironment::GetJoystickHatState(), PEBLObjects::GetPixelColor(), PEBLObjects::GetProperty(), PEBLEnvironment::GetTextBoxCursorFromClick(), PEBLObjects::GetVocalResponseTime(), PEBLList::IsMember(), PEBLObjects::Line(), PEBLList::ListToString(), PEBLObjects::LoadMovie(), PEBLMath::LogN(), PEBLObjects::MakeCanvas(), PEBLObjects::MakeColorRGB(), PEBLObjects::MakeFont(), PEBLObjects::MakeLabel(), PEBLObjects::MakeSineWave(), PEBLObjects::MakeTextBox(), PEBLObjects::MakeWindow(), PEBLList::Merge(), PEBLMath::Mod(), PEBLList::ModList(), PEBLObjects::Move(), PEBLList::Nth(), PEBLMath::NthRoot(), PEBLInterpret(), PEBLObjects::Polygon(), PEBLMath::Pow(), PEBLObjects::PropertyExists(), PEBLList::PushOnEnd(), PEBLMath::RandomBinomial(), PEBLMath::RandomLogNormal(), PEBLMath::RandomNormal(), PEBLObjects::RecordToBuffer(), PEBLObjects::Rectangle(), PEBLString::RegexMatch(), PEBLEnvironment::RegisterEvent(), PEBLObjects::RemoveObject(), PEBLList::Repeat(), PEBLList::RepeatList(), PEBLObjects::ResizeWindow(), PEBLList::Rotate(), PEBLObjects::RotoZoom(), PEBLMath::Round(), PEBLObjects::SaveAudioToWaveFile(), PEBLList::Second(), PEBLList::Sequence(), PEBLEnvironment::SetCursorPosition(), PEBLObjects::SetCursorPosition(), PEBLObjects::SetEditable(), PEBLList::SetElement(), PEBLObjects::SetEyeTrackerHandler(), PEBLObjects::SetFont(), PEBLObjects::SetPanning(), PEBLObjects::SetPlayRepeats(), PEBLObjects::SetPoint(), PEBLObjects::SetProperty(), PEBLObjects::SetText(), PEBLList::SortBy(), PEBLString::SplitString(), PEBLObjects::Square(), PEBLList::SubList(), PEBLString::SubString(), PEBLEnvironment::SystemCall(), PEBLEnvironment::SystemCallUpdate(), PEBLObjects::ThickLine(), PEBLList::Third(), PEBLEnvironment::WaitForListKeyPressWithTimeout(), and PEBLStream::WritePNG().
| void PList::PushBack | ( | const Variant & | v | ) |
Definition at line 149 of file PList.cpp.
Referenced by PEBLList::Append(), PEBLList::CrossFactorWithoutDuplicates(), PEBLList::DesignFullCounterbalance(), Evaluator::Evaluate(), Evaluator::Evaluate1(), PEBLUtility::ExtractJSONObject(), PEBLStream::FileReadList(), PEBLStream::FileReadTable(), PEBLObjects::GetAudioStats(), PlatformJoystick::GetBallState(), SDLUtility::GetCurrentScreenResolution(), PEBLEnvironment::GetCurrentScreenResolution(), PlatformEnvironment::GetCursorPosition(), PEBLUtility::GetDirectoryListing(), SDLUtility::GetDriverList(), PEBLStream::GetHTTPText(), PlatformTextBox::GetLineBreaks(), PlatformEnvironment::GetMouseState(), PEBLObjectBase::GetPropertyList(), PCustomObject::GetPropertyList(), PlatformEnvironment::GetScreenModes(), PEBLObjects::GetSize(), PEventLoop::Loop1(), PEBLList::Merge(), PEvent::operator Variant(), PEBLInterpret(), PEBLList::PushOnEnd(), PEBLMath::Recurse(), PEBLMath::Recurse2(), PEBLList::Repeat(), PEBLList::RepeatList(), PEBLList::Rotate(), PEBLList::Sequence(), PEBLList::Shuffle(), SortBy(), PEBLEnvironment::StartEventLoop(), PEBLList::SubList(), PEBLUtility::Tokenize(), PEBLList::Transpose(), PEBLEnvironment::WaitForMouseButton(), and PEBLEnvironment::WaitForMouseButtonWithTimeout().
| Variant PList::Rest | ( | ) |
|
protectedvirtual |
This is used by the friend function of PComplex Data <<, which calls the inheritable function SendToStream(). It just spits out the items of the list with spaces as separators. Since the items are variants, it uses the overloaded << operator for variants.
Reimplemented from PEBLObjectBase.
Definition at line 305 of file PList.cpp.
| void PList::SetElement | ( | unsigned int | n, |
| Variant | value | ||
| ) |
Definition at line 222 of file PList.cpp.
References PError::SignalFatalError().
Referenced by PEBLList::SetElement().
| counted_ptr< PEBLObjectBase > PList::SortBy | ( | const PList & | key | ) |
This sorts the member list by the values in another list. It does this by making a multiset, which is implicitly sorted, and then making the map back into a list.
Definition at line 253 of file PList.cpp.
References Begin(), End(), PList(), and PushBack().
Referenced by PEBLList::Shuffle(), PEBLList::Sort(), and PEBLList::SortBy().
|
friend |