File: attributes.cpp

package info (click to toggle)
atlas-cpp 0.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,192 kB
  • sloc: sh: 9,080; cpp: 6,447; xml: 3,660; python: 1,492; makefile: 166
file content (35 lines) | stat: -rw-r--r-- 850 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <Atlas/Objects/Operation.h>
#include <Atlas/Objects/Entity.h>
#include <Atlas/Objects/loadDefaults.h>

#include <iostream>
#include <cassert>

using Atlas::Objects::Root;
using Atlas::Objects::Operation::RootOperation;
using Atlas::Objects::Operation::Look;
using Atlas::Objects::Entity::Account;

int main(int argc, char** argv)
{
    Look rop;
    Account ac;

    assert(!rop->hasAttr("parents"));
    rop->setParents(std::list<std::string>(1, "foop"));
    assert(rop->hasAttr("parents"));
    
    assert(!rop->hasAttr("args"));
    rop->setArgs(std::vector<Root>(1, ac));
    assert(rop->hasAttr("args"));

    Root r;

    assert(!r->hasAttr("parents"));
    r->setParents(std::list<std::string>(1, "foo"));
    assert(r->hasAttr("parents"));

    assert(!r->hasAttr("name"));
    r->setName("bob");
    assert(r->hasAttr("name"));
}