~dominik-burgdoerfer/webplodder/0.4

« back to all changes in this revision

Viewing changes to libwesl/src/wesl/elements/subroutine.cpp

  • Committer: Dominik Burgdörfer
  • Date: 2010-07-07 14:35:20 UTC
  • Revision ID: dominik@domachine-20100707143520-wpywl29fsg9quz54
restructured sources

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// =======================================================================
 
2
// 
 
3
//       Filename:  subroutine.cpp
 
4
// 
 
5
//    Description:  
 
6
// 
 
7
//        Version:  1.0
 
8
//        Created:  30.06.2010 11:58:36
 
9
//       Revision:  none
 
10
//       Compiler:  g++
 
11
// 
 
12
//         Author:  Dominik 'domachine' Burgdörfer (-), dominik.burgdoerfer@googlemail.com
 
13
//        Company:  -
 
14
// 
 
15
// =======================================================================
 
16
 
 
17
#include "subroutine.hpp"
 
18
#include "../elementstack.hpp"
 
19
 
 
20
namespace wesl {
 
21
    namespace elements {
 
22
        Subroutine::Subroutine(Type type, 
 
23
                const boost::filesystem::path& sourcePath,
 
24
                const std::vector<std::string>& argumentNameList)
 
25
            : m_argumentNameList(argumentNameList),
 
26
            m_body(new ElementStack(sourcePath)),
 
27
            m_type(type)
 
28
        {
 
29
 
 
30
        }
 
31
 
 
32
        void Subroutine::addBodyElement(ElementPtr elementPtr) {
 
33
            m_body->push_back(elementPtr);
 
34
        }
 
35
 
 
36
        ElementStack& Subroutine::body() {
 
37
            return *m_body;
 
38
        }
 
39
 
 
40
        Subroutine::Type Subroutine::subroutineType() const
 
41
        {
 
42
            return m_type;
 
43
        }
 
44
    }
 
45
}