Esempio n. 1
0
int main()
{
    using compareType = bool (*)(const Sales_data &lhs, const Sales_data &rhs);

    std::multiset<Sales_data, compareType> bookstore(compareIsbn);

}
int main()
{
  // bookstore can have several transactions with the same ISBN. Elements in bookstore will be in ISBN order
  //std::multiset<Sales_data, decltype(compareIsbn)*> bookstore(compareIsbn); // Easy way. The explicit and elaborate way is:
  std::multiset<Sales_data, bool (*)(const Sales_data& , const Sales_data& )>  bookstore(compareIsbn);
  return 0;
}
Esempio n. 3
0
NodePtr DesktopNode::createBookStoreNode(const string& path)
{
    //if (LocalBookStoreNode::testStatus(path, status_filter))
    //{
        NodePtr bookstore(new LocalBookStoreNode(this, path));
        return bookstore;
    //}
    //return NodePtr();
}
Esempio n. 4
0
NodePtr DesktopNode::createPushedMessageNode(const string& path)
{
    //if (LocalFolderNode::testStatus(path, status_filter))
    //{
        NodePtr bookstore(new LocalFolderNode(this, path));
        bookstore->mutableType() = NODE_TYPE_CATEGORY_LOCAL_PUSHED;
        bookstore->mutableName() = nodeName(path);
        bookstore->mutableDisplayName() = nodeDisplayName(path);
        return bookstore;
    //}
    //return NodePtr();
}