I will try to save the sample code very simply, but it may have errors as I type it in place.
I have a class called Phone.
class Phone
{
public:
Phone(std::string manufacturer, std::string model, std::vector<Feature> features);
private:
std::vector<Features> features;
std::string model;
std::string manufacturer;
};
I have a structure called Feature.
struct Feature
{
Feature(std::string feature, std::string category);
std::string feature;
std::string category;
};
As you can see, the phone has a list (vector) of functions: i.e. Bluetooth, GPS, radio, etc., which have a category: network, navigation, multimedia.
Now information about phones and features is stored in the sqlite3 database. I have a helper function that will retrieve a specific phone model from the database and return a populated phone object. I also have a function that takes a Phone object and writes the Phone to the database.
, . , . -, , .
Phone
std::vector<Feature>::iterator begin()
std::vector<Feature>::iterator end()
, - , , .
http://accu.org/index.php/journals/1527, "memberspaces", . , , , .
, , , , .
.