stlab.adobe.com Adobe Systems Incorporated
external_model.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_EXTERNAL_MODEL_HPP
10 #define ADOBE_EXTERNAL_MODEL_HPP
11 
12 #include <adobe/config.hpp>
13 
14 #include <deque>
15 #include <map>
16 
17 #include <boost/signal.hpp>
18 #include <boost/function.hpp>
19 
21 #include <adobe/name.hpp>
22 #include <adobe/string.hpp>
23 
24 /*************************************************************************************************/
25 
26 namespace adobe {
32 /*************************************************************************************************/
33 
37 class external_model_t : boost::noncopyable
38 {
39  public:
40 
41  typedef boost::signals::connection connection_t;
43 
44  void add_cell(name_t);
45 
46  std::size_t count(name_t) const;
47  connection_t monitor(name_t name, const monitor_t& monitor);
48  void set(name_t, const any_regular_t&);
49 
50  void model_monitor(name_t name, const monitor_t& monitor);
51  void model_set(name_t, const any_regular_t&);
52 
53  private:
54  typedef boost::signal<void (const any_regular_t&)> monitor_list_t;
55 
56  struct cell_t
57  {
58  // empty copy and assignment - we don't move connections.
59  cell_t() { }
60  cell_t(const cell_t&) { }
61  cell_t& operator=(const cell_t&) { return *this; }
62 
63  monitor_list_t monitor_m;
64  monitor_t model_monitor_m;
65  };
66 
67  typedef std::map<const char*, cell_t*, str_less_t> index_t;
68 
69  cell_t* lookup(name_t);
70 
71  index_t index_m;
72  std::deque<cell_t> cell_set_m;
73 };
74 
75 /*************************************************************************************************/
76 
77 } // namespace adobe
78 
79 /*************************************************************************************************/
80 
81 #endif
82 
83 /*************************************************************************************************/
connection_t monitor(name_t name, const monitor_t &monitor)
boost::function< void(const any_regular_t &)> monitor_t
void model_set(name_t, const any_regular_t &)
void model_monitor(name_t name, const monitor_t &monitor)
boost::signals::connection connection_t
void set(name_t, const any_regular_t &)
A runtime polymorphic type similar to boost::any which can hold any type which models Regular...
std::size_t count(name_t) const

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google