PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PCustomObject.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/objects/PCustomObject.h
4// Purpose: Contains specs for a 'custom' object
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2014-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PCUSTOMOBJECT_H__
28#define __PCUSTOMOBJECT_H__
29
30#include "../base/PEBLObject.h"
31#include "../utility/rc_ptrs.h"
32#include <string>
33
35
36class PCustomObject: virtual public PEBLObjectBase
37{
38public:
40 PCustomObject(const std::string & text);
42 virtual ~PCustomObject();
43
44 //overloaded generic PObject methods
45 virtual bool SetProperty(std::string, Variant v);
46 virtual Variant GetProperty(std::string)const;
47 virtual ObjectValidationError ValidateProperty(std::string, Variant v)const;
48 virtual ObjectValidationError ValidateProperty(std::string)const;
49
50 std::list<std::string> GetObjectOrder (){return mObjectOrder;};
51
52private:
53
54
55protected:
56
57 std::string mName;
58 std::list<std::string> mObjectOrder; //keeps track of the order of objects, so it is not
59 //alphabetical; used only for printout etc.
60 virtual std::ostream & SendToStream(std::ostream& out) const;
61 virtual std::string ObjectName()const;
62 virtual std::ostream & PrintProperties(std::ostream& out);
63 virtual Variant GetPropertyList();
64
65
66};
67
68
69#endif
ObjectValidationError
Definition PEBLObject.h:37
This class simply represent an abstract text-based object.
virtual ObjectValidationError ValidateProperty(std::string, Variant v) const
virtual Variant GetProperty(std::string) const
virtual bool SetProperty(std::string, Variant v)
virtual std::string ObjectName() const
std::string mName
virtual std::ostream & SendToStream(std::ostream &out) const
This sends the color descriptions to the specified stream.
virtual std::ostream & PrintProperties(std::ostream &out)
std::list< std::string > GetObjectOrder()
virtual ~PCustomObject()
std::list< std::string > mObjectOrder
virtual Variant GetPropertyList()