|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <PComplexData.h>
Public Member Functions | |
| PComplexData () | |
| PComplexData (const counted_ptr< PEBLObjectBase > &object) | |
| PComplexData (const PComplexData &pcd) | |
| Copy Constructors. | |
| PComplexData (const PComplexData *pcd) | |
| This is a generic copy constructor. | |
| ~PComplexData () | |
| Destructor. Does not destroy the pointed-to contents. | |
| ComplexDataType | GetType () const |
| std::string | GetTypeName () const |
| PList * | GetList () const |
| counted_ptr< PEBLObjectBase > | GetObject () const |
| counted_ptr< PEBLObjectBase > | GetPEBLObject () const |
| PlatformWidget * | GetWidget () const |
| bool | IsList () const |
| bool | IsEnvironment () const |
| bool | IsWidget () const |
| bool | IsWindow () const |
| bool | IsColor () const |
| bool | IsFont () const |
| bool | IsTextObject () const |
| bool | IsLabel () const |
| bool | IsTextBox () const |
| bool | IsImageBox () const |
| bool | IsKeyboard () const |
| bool | IsFileStream () const |
| bool | IsAudioOut () const |
| bool | IsNetworkConnection () const |
| bool | IsDrawObject () const |
| bool | IsThickLine () const |
| bool | IsDrawCircle () const |
| bool | IsDrawSquare () const |
| bool | IsDrawRectangle () const |
| bool | IsCanvas () const |
| bool | IsJoystick () const |
| bool | IsParallelPort () const |
| bool | IsComPort () const |
| bool | IsMovie () const |
| bool | IsCustomObject () const |
| void | SetProperty (std::string, Variant v) |
| Variant | GetProperty (std::string prop) const |
| bool | PropertyExists (std::string prop) const |
Protected Member Functions | |
| std::ostream & | SendToStream (std::ostream &out) const |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const PComplexData &pcd) |
This class contains pointers to each type of complex data. Only one should be valid at a time–this is sort of a 'union' but it allows using classes, and shields the complexity from Variant. A pointer to a PComplexData can be stored in A Variant. The decision to make these classes be contained within PComplexData, rather than inheriting from it, was made to avoid too-frequent and dangerous down-casting. Design Note: This class uses the rc_ptr template class extensively to allow automatic memory management for referenced data objects. All contained data structures are stored as rc pointers, initialized to 0. Whenever the a new copy of something is created, it is done with rc_ptrs so they automagically get cleaned up. The GetWidgets method returns raw pointers because I couldn't determine how to return a casted counted pointer. Anyone who uses this should be wary.
Definition at line 87 of file PComplexData.h.
| PComplexData::PComplexData | ( | ) |
This class is the base class that all complex data types inherit from. A pointer to a PComplexData can be stored in A Variant.
Definition at line 44 of file PComplexData.cpp.
| PComplexData::PComplexData | ( | const counted_ptr< PEBLObjectBase > & | object | ) |
Definition at line 51 of file PComplexData.cpp.
| PComplexData::PComplexData | ( | const PComplexData & | pcd | ) |
Copy Constructors.
This is a generic copy constructor.
Definition at line 63 of file PComplexData.cpp.
| PComplexData::PComplexData | ( | const PComplexData * | pcd | ) |
This is a generic copy constructor.
Definition at line 69 of file PComplexData.cpp.
| PComplexData::~PComplexData | ( | ) |
Destructor. Does not destroy the pointed-to contents.
Definition at line 56 of file PComplexData.cpp.
| PList * PComplexData::GetList | ( | ) | const |
Definition at line 339 of file PComplexData.cpp.
References counted_ptr< X >::get(), IsList(), and NULL.
Referenced by PEBLMath::Abs(), PEBLMath::AbsFloor(), PEBLMath::ACos(), PEBLObjects::AddObject(), PEBLList::Append(), PEBLStream::AppendFile(), PEBLMath::ASin(), PEBLMath::ATan(), PEBLObjects::Bezier(), 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(), PlatformPolygon::Draw(), PlatformBezier::Draw(), PEBLObjects::Draw(), PEBLObjects::DrawFor(), PEBLObjects::Ellipse(), PEBLStream::EndOfFile(), PEBLStream::EndOfLine(), 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(), PEventLoop::Loop1(), 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(), PEBLMath::Recurse(), PEBLMath::Recurse2(), 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(), PEBLEnvironment::SystemCallUpdate(), 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().
| counted_ptr< PEBLObjectBase > PComplexData::GetObject | ( | ) | const |
Definition at line 99 of file PComplexData.cpp.
Referenced by PEBLList::Append(), Evaluator::CallFunction(), PEBLList::CrossFactorWithoutDuplicates(), PEBLList::DesignFullCounterbalance(), PlatformWindow::Draw(), PEBLObjects::Draw(), PEBLObjects::DrawFor(), Variant::Equal(), Evaluator::Evaluate(), Evaluator::Evaluate1(), PEBLList::Fifth(), PEBLList::First(), PEBLList::Fourth(), PEBLObjects::GetAudioStats(), PFont::GetBackgroundColorPtr(), PDrawObject::GetColor(), PEBLObjects::GetCursorPosition(), PEBLObjects::GetEyeObject(), PFont::GetFontColorPtr(), PEBLEnvironment::GetInput0(), PEBLEnvironment::GetJoystickAxisState(), PEBLEnvironment::GetJoystickBallState(), PEBLEnvironment::GetJoystickButtonState(), PEBLEnvironment::GetJoystickHatState(), PEBLObjects::GetLineBreaks(), PEBLEnvironment::GetNumJoystickAxes(), PEBLEnvironment::GetNumJoystickBalls(), PEBLEnvironment::GetNumJoystickButtons(), PEBLEnvironment::GetNumJoystickHats(), PDrawObject::GetOutlineColor(), PEBLObjects::GetParent(), PEBLObjects::GetPixelColor(), PEBLObjects::GetPropertyList(), PEBLObjects::GetSize(), Variant::GetString(), PEBLObjects::GetText(), PEBLEnvironment::GetTextBoxCursorFromClick(), PEBLObjects::GetVocalResponseTime(), PEBLObjects::Hide(), PEBLList::IsMember(), PEBLList::Last(), PEBLList::Length(), PEBLList::ListToString(), PEBLObjects::LoadMovie(), PEBLObjects::MakeFont(), PEBLObjects::MakeLabel(), PEBLObjects::MakeTextBox(), PEBLObjects::MakeWindow(), PEBLList::Merge(), PEBLList::ModList(), PEBLObjects::Move(), PEBLList::Nth(), PEBLMath::NthRoot(), PEBLObjects::PausePlayback(), PEBLObjects::PlayBackground(), PEBLObjects::PlayForeground(), PEBLEnvironment::PlayMovie(), PEBLMath::Pow(), PEBLObjects::PrintProperties(), PEBLList::PushOnEnd(), PEBLObjects::RecordToBuffer(), PEBLEnvironment::RegisterEvent(), PEBLObjects::RemoveObject(), PEBLList::RepeatList(), PEBLObjects::ResizeWindow(), PEBLObjects::RotoZoom(), PEBLObjects::SaveAudioToWaveFile(), PEBLList::Second(), PCanvas::SetColor(), PEBLObjects::SetCursorPosition(), PEBLObjects::SetEditable(), PEBLObjects::SetEyeTrackerHandler(), PEBLObjects::SetFont(), PEBLObjects::SetPanning(), PEBLObjects::SetPlayRepeats(), PEBLObjects::SetPoint(), PFont::SetProperty(), PlatformLabel::SetProperty(), PlatformTextBox::SetProperty(), PEBLObjects::SetText(), PEBLObjects::Show(), PEBLList::Shuffle(), PEBLList::Sort(), PEBLList::SortBy(), PEBLObjects::StartPlayback(), PEBLObjects::Stop(), PEBLObjects::StopAudioMonitor(), PEBLList::SubList(), PEBLList::Third(), PEBLList::Transpose(), and PEBLStream::WritePNG().
| counted_ptr< PEBLObjectBase > PComplexData::GetPEBLObject | ( | ) | const |
Definition at line 107 of file PComplexData.cpp.
| Variant PComplexData::GetProperty | ( | std::string | prop | ) | const |
Definition at line 189 of file PComplexData.cpp.
References PEBLObjectBase::GetProperty().
Referenced by PEBLObjects::GetProperty(), PEBLUtility::ResolvePropertyChain(), and PEBLUtility::SetPropertyChain().
| ComplexDataType PComplexData::GetType | ( | ) | const |
Definition at line 92 of file PComplexData.cpp.
References CDT_UNDEFINED, counted_ptr< X >::get(), PEBLObjectBase::GetType(), and NULL.
Referenced by GetTypeName(), IsAudioOut(), IsCanvas(), IsColor(), IsComPort(), IsCustomObject(), IsDrawObject(), IsEnvironment(), IsFileStream(), IsFont(), IsImageBox(), IsJoystick(), IsKeyboard(), IsLabel(), IsList(), IsMovie(), IsNetworkConnection(), IsParallelPort(), IsTextBox(), IsTextObject(), IsThickLine(), IsWidget(), and IsWindow().
| std::string PComplexData::GetTypeName | ( | ) | const |
Definition at line 112 of file PComplexData.cpp.
References CDT_AUDIOOUT, CDT_COLOR, CDT_COMPORT, CDT_CUSTOMOBJECT, CDT_DRAWOBJECT, CDT_ENVIRONMENT, CDT_FILESTREAM, CDT_FONT, CDT_IMAGEBOX, CDT_JOYSTICK, CDT_KEYBOARD, CDT_LABEL, CDT_LIST, CDT_MOVIE, CDT_NETWORKCONNECTION, CDT_PARALLELPORT, CDT_TEXTBOX, CDT_THICKLINE, CDT_UNDEFINED, CDT_WINDOW, and GetType().
| PlatformWidget * PComplexData::GetWidget | ( | ) | const |
| bool PComplexData::IsAudioOut | ( | ) | const |
Definition at line 285 of file PComplexData.cpp.
References CDT_AUDIOOUT, and GetType().
| bool PComplexData::IsCanvas | ( | ) | const |
Definition at line 303 of file PComplexData.cpp.
References CDT_CANVAS, and GetType().
| bool PComplexData::IsColor | ( | ) | const |
| bool PComplexData::IsComPort | ( | ) | const |
Definition at line 320 of file PComplexData.cpp.
References CDT_COMPORT, and GetType().
| bool PComplexData::IsCustomObject | ( | ) | const |
Definition at line 332 of file PComplexData.cpp.
References CDT_CUSTOMOBJECT, and GetType().
Referenced by Evaluator::CallFunction(), and Evaluator::Evaluate1().
| bool PComplexData::IsDrawCircle | ( | ) | const |
| bool PComplexData::IsDrawObject | ( | ) | const |
Definition at line 291 of file PComplexData.cpp.
References CDT_DRAWOBJECT, and GetType().
| bool PComplexData::IsDrawRectangle | ( | ) | const |
| bool PComplexData::IsDrawSquare | ( | ) | const |
| bool PComplexData::IsEnvironment | ( | ) | const |
Definition at line 212 of file PComplexData.cpp.
References CDT_ENVIRONMENT, and GetType().
| bool PComplexData::IsFileStream | ( | ) | const |
Definition at line 280 of file PComplexData.cpp.
References CDT_FILESTREAM, and GetType().
| bool PComplexData::IsFont | ( | ) | const |
| bool PComplexData::IsImageBox | ( | ) | const |
Definition at line 263 of file PComplexData.cpp.
References CDT_IMAGEBOX, and GetType().
| bool PComplexData::IsJoystick | ( | ) | const |
Definition at line 269 of file PComplexData.cpp.
References CDT_JOYSTICK, and GetType().
| bool PComplexData::IsKeyboard | ( | ) | const |
Definition at line 275 of file PComplexData.cpp.
References CDT_KEYBOARD, and GetType().
| bool PComplexData::IsLabel | ( | ) | const |
Definition at line 251 of file PComplexData.cpp.
References CDT_LABEL, and GetType().
Referenced by PEBLObjects::SetFont(), and PEBLObjects::SetText().
| bool PComplexData::IsList | ( | ) | const |
Definition at line 206 of file PComplexData.cpp.
References CDT_LIST, and GetType().
Referenced by PEBLMath::Abs(), PEBLMath::AbsFloor(), PEBLMath::ACos(), PEBLMath::ASin(), PEBLMath::ATan(), PEBLMath::Ceiling(), PEBLMath::Cos(), PEBLMath::DegToRad(), PEBLMath::Exp(), PEBLMath::Floor(), GetList(), PEBLEnvironment::IsPEBLObject(), PEBLMath::Ln(), PEBLMath::Log10(), PEBLMath::Log2(), PEBLMath::LogN(), PEBLMath::NthRoot(), PEBLMath::Pow(), PEBLMath::RadToDeg(), PEBLMath::Round(), PEBLMath::Sign(), PEBLMath::Sin(), PEBLMath::Sqrt(), and PEBLMath::Tan().
| bool PComplexData::IsMovie | ( | ) | const |
| bool PComplexData::IsNetworkConnection | ( | ) | const |
Definition at line 309 of file PComplexData.cpp.
References CDT_NETWORKCONNECTION, and GetType().
| bool PComplexData::IsParallelPort | ( | ) | const |
Definition at line 315 of file PComplexData.cpp.
References CDT_PARALLELPORT, and GetType().
| bool PComplexData::IsTextBox | ( | ) | const |
Definition at line 256 of file PComplexData.cpp.
References CDT_TEXTBOX, and GetType().
| bool PComplexData::IsTextObject | ( | ) | const |
Definition at line 246 of file PComplexData.cpp.
References CDT_LABEL, CDT_TEXTBOX, and GetType().
| bool PComplexData::IsThickLine | ( | ) | const |
Definition at line 297 of file PComplexData.cpp.
References CDT_THICKLINE, and GetType().
Referenced by PEBLObjects::Move().
| bool PComplexData::IsWidget | ( | ) | const |
Definition at line 218 of file PComplexData.cpp.
References CDT_CANVAS, CDT_CUSTOMOBJECT, CDT_DRAWOBJECT, CDT_IMAGEBOX, CDT_LABEL, CDT_MOVIE, CDT_TEXTBOX, CDT_THICKLINE, CDT_WINDOW, and GetType().
| bool PComplexData::IsWindow | ( | ) | const |
Definition at line 229 of file PComplexData.cpp.
References CDT_WINDOW, and GetType().
| bool PComplexData::PropertyExists | ( | std::string | prop | ) | const |
Definition at line 195 of file PComplexData.cpp.
References OVE_SUCCESS, and PEBLObjectBase::ValidateProperty().
Referenced by PEBLObjects::PropertyExists().
|
protected |
Definition at line 85 of file PComplexData.cpp.
Referenced by operator<<().
| void PComplexData::SetProperty | ( | std::string | prop, |
| Variant | v | ||
| ) |
Definition at line 182 of file PComplexData.cpp.
References PEBLObjectBase::SetProperty().
Referenced by PEBLObjects::SetProperty(), and PEBLUtility::SetPropertyChain().
|
friend |