3 #ifndef __SOMETHING_H_INCLUDED__
4 #define __SOMETHING_H_INCLUDED__
34 //====== LIFECYCLE ========
36 SomeThing(std::string name);
43 //====== OPERATIONS =======
46 * Add a new instant to the thing
47 * @param instant: new instant
50 bool addInstant(Instant* instant);
53 //====== INQUIRY =========
55 * Get the thing stored
62 * Get the name of the thing
66 std::string getName();
69 * Get all the instants
73 std::vector<Instant*>* getInstants();
76 * Get the instant that's in the index given
77 * @param indexInstant: index of the instant that they want
78 * @return instants[instantIndex]
81 Instant* getInstant(int indexInstant);
84 * Get the number of instants that the
86 * @return instants.size()
89 int getNumberInstants();
92 * if this is in the instant given
93 * @param instant: instant to verified if this has it
94 * @return 0<=i<numberOfInstants if this has the instant, -1 otherwise
97 int hasInstant(Instant* instant);
99 //====== ACCESS ==========
105 void setThing(U thing);
108 * Set the name of the thing
112 void setName(std::string name);
115 * Set the instants of the thing
119 void setInstants(std::vector<Instant*> instants);
122 * Remove an instant from the thing
123 * @param indexInstant: index of the instant to be removed
124 * @return true if succesful , false otherwise
127 bool removeInstant(int indexInstant);
130 * Remove an instant from the thing
131 * @param instant: instant to be deleted
132 * @return true if succesful , false otherwise
135 bool removeInstant(Instant* instant);
140 //======= ATTRIBUTES=======
142 * name of the something
144 * has to be different from the
145 * other existing somethings in the program
148 std::string nameThing;
150 * the thing that we are handling
151 * it could be any object
155 * instants that the thing
158 std::vector<Instant*> instantsVector;
161 //include the implementation of the template
162 #include "SomeThing_Txx.h"