tizen 2.3 release
[framework/web/wearable/wrt-security.git] / ace / include / ace / Subject.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 //
17 // File:   Subject.h
18 // Author: notroot
19 //
20 // Created on June 2, 2009, 8:47 AM
21 //
22
23 #ifndef _SUBJECT_H
24 #define    _SUBJECT_H
25
26 #include <set>
27 #include <list>
28 #include <iostream>
29 #include <dpl/assert.h>
30 #include <dpl/noncopyable.h>
31
32 #include "Attribute.h"
33
34 class Subject : DPL::Noncopyable
35 {
36     std::string subjectId;
37     std::list<Attribute> targetAttributes;
38
39   public:
40     Subject()
41     {}
42
43     const std::list<Attribute>& getTargetAttributes() const;
44
45     void setSubjectId(const std::string & subjectId)
46     {
47         this->subjectId = subjectId;
48     }
49
50     //TODO maybe we should remove that becuase this causes a memory leak right now!! [CR] maybe thats true, maybe whe can remove this fun
51     // KW    void setTargetAttributes(std::list<Attribute> * targetAttributes){ this->targetAttributes = targetAttributes; }
52
53     const std::string & getSubjectId() const
54     {
55         return this->subjectId;
56     }
57
58     void addNewAttribute(Attribute & attr)
59     {
60         this->targetAttributes.push_back(attr);
61     }
62
63     //TODO in 1.0 change to true/false/undetermined
64     bool matchSubject(const AttributeSet *attrSet,
65             bool &isUndetermined) const;
66
67     ~Subject()
68     {}
69 };
70
71 #endif    /* _SUBJECT_H */
72