dbus-cxx logo
method.h
Go to the documentation of this file.
1 
2 // -*- c++ -*-
3 /* Do not edit! -- generated file */
4 
5 /***************************************************************************
6  * Copyright (C) 2009,2010 by Rick L. Vinyard, Jr. *
7  * rvinyard@cs.nmsu.edu *
8  * *
9  * This file is part of the dbus-cxx library. *
10  * *
11  * The dbus-cxx library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU General Public License *
13  * version 3 as published by the Free Software Foundation. *
14  * *
15  * The dbus-cxx library is distributed in the hope that it will be *
16  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
17  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
18  * General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this software. If not see <http://www.gnu.org/licenses/>. *
22  ***************************************************************************/
23 #include <sstream>
24 #include <dbus-cxx/utility.h>
25 #include <dbus-cxx/forward_decls.h>
26 #include <dbus-cxx/methodbase.h>
27 #include <dbus-cxx/errormessage.h>
28 #include <dbus-cxx/headerlog.h>
29 #include <exception>
30 #include <ostream>
31 
32 #ifndef DBUSCXX_METHOD_H
33 #define DBUSCXX_METHOD_H
34 
35 
36 namespace DBus {
37 
44  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
45  class Method
46  : public MethodBase
47  {
48  public:
49 
50  typedef DBusCxxPointer<Method> pointer;
51 
52  Method(const std::string& name): MethodBase(name) { }
53 
54  virtual ~Method() { }
55 
56  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
58 
59  void set_method( sigc::slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> slot )
60  { m_slot = slot; }
61 
62  static pointer create(const std::string& name)
63  { return pointer( new Method(name) ); }
64 
66  { return MethodBase::pointer( new Method(this->name()) ); }
67 
69  virtual std::string introspect(int space_depth=0) const
70  {
71  std::ostringstream sout;
72  std::string spaces;
73  for (int i=0; i < space_depth; i++ ) spaces += " ";
74  sout << spaces << "<method name=\"" << name() << "\">\n";
75  T_return type;
76  sout << spaces << " <arg name=\"" << m_arg_names[0]
77  << "\" type=\"" << signature(type)
78  << "\" direction=\"out\"/>\n";
79  T_arg1 arg1;
80  sout << spaces << " <arg name=\"" << m_arg_names[1]
81  << "\" type=\"" << signature(arg1)
82  << "\" direction=\"in\"/>\n";
83  T_arg2 arg2;
84  sout << spaces << " <arg name=\"" << m_arg_names[2]
85  << "\" type=\"" << signature(arg2)
86  << "\" direction=\"in\"/>\n";
87  T_arg3 arg3;
88  sout << spaces << " <arg name=\"" << m_arg_names[3]
89  << "\" type=\"" << signature(arg3)
90  << "\" direction=\"in\"/>\n";
91  T_arg4 arg4;
92  sout << spaces << " <arg name=\"" << m_arg_names[4]
93  << "\" type=\"" << signature(arg4)
94  << "\" direction=\"in\"/>\n";
95  T_arg5 arg5;
96  sout << spaces << " <arg name=\"" << m_arg_names[5]
97  << "\" type=\"" << signature(arg5)
98  << "\" direction=\"in\"/>\n";
99  T_arg6 arg6;
100  sout << spaces << " <arg name=\"" << m_arg_names[6]
101  << "\" type=\"" << signature(arg6)
102  << "\" direction=\"in\"/>\n";
103  T_arg7 arg7;
104  sout << spaces << " <arg name=\"" << m_arg_names[7]
105  << "\" type=\"" << signature(arg7)
106  << "\" direction=\"in\"/>\n";
107  sout << spaces << "</method>\n";
108  return sout.str();
109  }
110 
111  virtual std::string arg_name(size_t i) {
112  if ( i < 7+1 ) return m_arg_names[i];
113  return std::string();
114  }
115 
116  virtual void set_arg_name(size_t i, const std::string& name) {
117  if ( i < 7+1 ) m_arg_names[i] = name;
118  }
119 
120  protected:
121 
122  std::string m_arg_names[7+1];
123 
124  sigc::slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> m_slot;
125 
126  };
127 
128 
135  template <class T_return>
136  class Method <T_return, nil,nil,nil,nil,nil,nil,nil>
137  : public MethodBase
138  {
139  public:
140 
141  typedef DBusCxxPointer<Method> pointer;
142 
143  Method(const std::string& name): MethodBase(name) { }
144 
145  virtual ~Method() { }
146 
147  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
148  CallMessage::const_pointer message );
149 
150  void set_method( sigc::slot0<T_return> slot )
151  { m_slot = slot; }
152 
153  static pointer create(const std::string& name)
154  { return pointer( new Method(name) ); }
155 
157  { return MethodBase::pointer( new Method(this->name()) ); }
158 
160  virtual std::string introspect(int space_depth=0) const
161  {
162  std::ostringstream sout;
163  std::string spaces;
164  for (int i=0; i < space_depth; i++ ) spaces += " ";
165  sout << spaces << "<method name=\"" << name() << "\">\n";
166  T_return type;
167  sout << spaces << " <arg name=\"" << m_arg_names[0]
168  << "\" type=\"" << signature(type)
169  << "\" direction=\"out\"/>\n";
170  sout << spaces << "</method>\n";
171  return sout.str();
172  }
173 
174  virtual std::string arg_name(size_t i) {
175  if ( i < 0+1 ) return m_arg_names[i];
176  return std::string();
177  }
178 
179  virtual void set_arg_name(size_t i, const std::string& name) {
180  if ( i < 0+1 ) m_arg_names[i] = name;
181  }
182 
183  protected:
184 
185  std::string m_arg_names[0+1];
186 
187  sigc::slot0<T_return> m_slot;
188 
189  };
190 
197  template <class T_return, class T_arg1>
198  class Method <T_return, T_arg1, nil,nil,nil,nil,nil,nil>
199  : public MethodBase
200  {
201  public:
202 
203  typedef DBusCxxPointer<Method> pointer;
204 
205  Method(const std::string& name): MethodBase(name) { }
206 
207  virtual ~Method() { }
208 
209  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
210  CallMessage::const_pointer message );
211 
212  void set_method( sigc::slot1<T_return, T_arg1> slot )
213  { m_slot = slot; }
214 
215  static pointer create(const std::string& name)
216  { return pointer( new Method(name) ); }
217 
219  { return MethodBase::pointer( new Method(this->name()) ); }
220 
222  virtual std::string introspect(int space_depth=0) const
223  {
224  std::ostringstream sout;
225  std::string spaces;
226  for (int i=0; i < space_depth; i++ ) spaces += " ";
227  sout << spaces << "<method name=\"" << name() << "\">\n";
228  T_return type;
229  sout << spaces << " <arg name=\"" << m_arg_names[0]
230  << "\" type=\"" << signature(type)
231  << "\" direction=\"out\"/>\n";
232  T_arg1 arg1;
233  sout << spaces << " <arg name=\"" << m_arg_names[1]
234  << "\" type=\"" << signature(arg1)
235  << "\" direction=\"in\"/>\n";
236  sout << spaces << "</method>\n";
237  return sout.str();
238  }
239 
240  virtual std::string arg_name(size_t i) {
241  if ( i < 1+1 ) return m_arg_names[i];
242  return std::string();
243  }
244 
245  virtual void set_arg_name(size_t i, const std::string& name) {
246  if ( i < 1+1 ) m_arg_names[i] = name;
247  }
248 
249  protected:
250 
251  std::string m_arg_names[1+1];
252 
253  sigc::slot1<T_return, T_arg1> m_slot;
254 
255  };
256 
263  template <class T_return, class T_arg1,class T_arg2>
264  class Method <T_return, T_arg1,T_arg2, nil,nil,nil,nil,nil>
265  : public MethodBase
266  {
267  public:
268 
269  typedef DBusCxxPointer<Method> pointer;
270 
271  Method(const std::string& name): MethodBase(name) { }
272 
273  virtual ~Method() { }
274 
275  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
276  CallMessage::const_pointer message );
277 
278  void set_method( sigc::slot2<T_return, T_arg1,T_arg2> slot )
279  { m_slot = slot; }
280 
281  static pointer create(const std::string& name)
282  { return pointer( new Method(name) ); }
283 
285  { return MethodBase::pointer( new Method(this->name()) ); }
286 
288  virtual std::string introspect(int space_depth=0) const
289  {
290  std::ostringstream sout;
291  std::string spaces;
292  for (int i=0; i < space_depth; i++ ) spaces += " ";
293  sout << spaces << "<method name=\"" << name() << "\">\n";
294  T_return type;
295  sout << spaces << " <arg name=\"" << m_arg_names[0]
296  << "\" type=\"" << signature(type)
297  << "\" direction=\"out\"/>\n";
298  T_arg1 arg1;
299  sout << spaces << " <arg name=\"" << m_arg_names[1]
300  << "\" type=\"" << signature(arg1)
301  << "\" direction=\"in\"/>\n";
302  T_arg2 arg2;
303  sout << spaces << " <arg name=\"" << m_arg_names[2]
304  << "\" type=\"" << signature(arg2)
305  << "\" direction=\"in\"/>\n";
306  sout << spaces << "</method>\n";
307  return sout.str();
308  }
309 
310  virtual std::string arg_name(size_t i) {
311  if ( i < 2+1 ) return m_arg_names[i];
312  return std::string();
313  }
314 
315  virtual void set_arg_name(size_t i, const std::string& name) {
316  if ( i < 2+1 ) m_arg_names[i] = name;
317  }
318 
319  protected:
320 
321  std::string m_arg_names[2+1];
322 
323  sigc::slot2<T_return, T_arg1,T_arg2> m_slot;
324 
325  };
326 
333  template <class T_return, class T_arg1,class T_arg2,class T_arg3>
334  class Method <T_return, T_arg1,T_arg2,T_arg3, nil,nil,nil,nil>
335  : public MethodBase
336  {
337  public:
338 
339  typedef DBusCxxPointer<Method> pointer;
340 
341  Method(const std::string& name): MethodBase(name) { }
342 
343  virtual ~Method() { }
344 
345  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
346  CallMessage::const_pointer message );
347 
348  void set_method( sigc::slot3<T_return, T_arg1,T_arg2,T_arg3> slot )
349  { m_slot = slot; }
350 
351  static pointer create(const std::string& name)
352  { return pointer( new Method(name) ); }
353 
355  { return MethodBase::pointer( new Method(this->name()) ); }
356 
358  virtual std::string introspect(int space_depth=0) const
359  {
360  std::ostringstream sout;
361  std::string spaces;
362  for (int i=0; i < space_depth; i++ ) spaces += " ";
363  sout << spaces << "<method name=\"" << name() << "\">\n";
364  T_return type;
365  sout << spaces << " <arg name=\"" << m_arg_names[0]
366  << "\" type=\"" << signature(type)
367  << "\" direction=\"out\"/>\n";
368  T_arg1 arg1;
369  sout << spaces << " <arg name=\"" << m_arg_names[1]
370  << "\" type=\"" << signature(arg1)
371  << "\" direction=\"in\"/>\n";
372  T_arg2 arg2;
373  sout << spaces << " <arg name=\"" << m_arg_names[2]
374  << "\" type=\"" << signature(arg2)
375  << "\" direction=\"in\"/>\n";
376  T_arg3 arg3;
377  sout << spaces << " <arg name=\"" << m_arg_names[3]
378  << "\" type=\"" << signature(arg3)
379  << "\" direction=\"in\"/>\n";
380  sout << spaces << "</method>\n";
381  return sout.str();
382  }
383 
384  virtual std::string arg_name(size_t i) {
385  if ( i < 3+1 ) return m_arg_names[i];
386  return std::string();
387  }
388 
389  virtual void set_arg_name(size_t i, const std::string& name) {
390  if ( i < 3+1 ) m_arg_names[i] = name;
391  }
392 
393  protected:
394 
395  std::string m_arg_names[3+1];
396 
397  sigc::slot3<T_return, T_arg1,T_arg2,T_arg3> m_slot;
398 
399  };
400 
407  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
408  class Method <T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil,nil,nil>
409  : public MethodBase
410  {
411  public:
412 
413  typedef DBusCxxPointer<Method> pointer;
414 
415  Method(const std::string& name): MethodBase(name) { }
416 
417  virtual ~Method() { }
418 
419  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
420  CallMessage::const_pointer message );
421 
422  void set_method( sigc::slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4> slot )
423  { m_slot = slot; }
424 
425  static pointer create(const std::string& name)
426  { return pointer( new Method(name) ); }
427 
429  { return MethodBase::pointer( new Method(this->name()) ); }
430 
432  virtual std::string introspect(int space_depth=0) const
433  {
434  std::ostringstream sout;
435  std::string spaces;
436  for (int i=0; i < space_depth; i++ ) spaces += " ";
437  sout << spaces << "<method name=\"" << name() << "\">\n";
438  T_return type;
439  sout << spaces << " <arg name=\"" << m_arg_names[0]
440  << "\" type=\"" << signature(type)
441  << "\" direction=\"out\"/>\n";
442  T_arg1 arg1;
443  sout << spaces << " <arg name=\"" << m_arg_names[1]
444  << "\" type=\"" << signature(arg1)
445  << "\" direction=\"in\"/>\n";
446  T_arg2 arg2;
447  sout << spaces << " <arg name=\"" << m_arg_names[2]
448  << "\" type=\"" << signature(arg2)
449  << "\" direction=\"in\"/>\n";
450  T_arg3 arg3;
451  sout << spaces << " <arg name=\"" << m_arg_names[3]
452  << "\" type=\"" << signature(arg3)
453  << "\" direction=\"in\"/>\n";
454  T_arg4 arg4;
455  sout << spaces << " <arg name=\"" << m_arg_names[4]
456  << "\" type=\"" << signature(arg4)
457  << "\" direction=\"in\"/>\n";
458  sout << spaces << "</method>\n";
459  return sout.str();
460  }
461 
462  virtual std::string arg_name(size_t i) {
463  if ( i < 4+1 ) return m_arg_names[i];
464  return std::string();
465  }
466 
467  virtual void set_arg_name(size_t i, const std::string& name) {
468  if ( i < 4+1 ) m_arg_names[i] = name;
469  }
470 
471  protected:
472 
473  std::string m_arg_names[4+1];
474 
475  sigc::slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4> m_slot;
476 
477  };
478 
485  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
486  class Method <T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil,nil>
487  : public MethodBase
488  {
489  public:
490 
491  typedef DBusCxxPointer<Method> pointer;
492 
493  Method(const std::string& name): MethodBase(name) { }
494 
495  virtual ~Method() { }
496 
497  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
498  CallMessage::const_pointer message );
499 
500  void set_method( sigc::slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> slot )
501  { m_slot = slot; }
502 
503  static pointer create(const std::string& name)
504  { return pointer( new Method(name) ); }
505 
507  { return MethodBase::pointer( new Method(this->name()) ); }
508 
510  virtual std::string introspect(int space_depth=0) const
511  {
512  std::ostringstream sout;
513  std::string spaces;
514  for (int i=0; i < space_depth; i++ ) spaces += " ";
515  sout << spaces << "<method name=\"" << name() << "\">\n";
516  T_return type;
517  sout << spaces << " <arg name=\"" << m_arg_names[0]
518  << "\" type=\"" << signature(type)
519  << "\" direction=\"out\"/>\n";
520  T_arg1 arg1;
521  sout << spaces << " <arg name=\"" << m_arg_names[1]
522  << "\" type=\"" << signature(arg1)
523  << "\" direction=\"in\"/>\n";
524  T_arg2 arg2;
525  sout << spaces << " <arg name=\"" << m_arg_names[2]
526  << "\" type=\"" << signature(arg2)
527  << "\" direction=\"in\"/>\n";
528  T_arg3 arg3;
529  sout << spaces << " <arg name=\"" << m_arg_names[3]
530  << "\" type=\"" << signature(arg3)
531  << "\" direction=\"in\"/>\n";
532  T_arg4 arg4;
533  sout << spaces << " <arg name=\"" << m_arg_names[4]
534  << "\" type=\"" << signature(arg4)
535  << "\" direction=\"in\"/>\n";
536  T_arg5 arg5;
537  sout << spaces << " <arg name=\"" << m_arg_names[5]
538  << "\" type=\"" << signature(arg5)
539  << "\" direction=\"in\"/>\n";
540  sout << spaces << "</method>\n";
541  return sout.str();
542  }
543 
544  virtual std::string arg_name(size_t i) {
545  if ( i < 5+1 ) return m_arg_names[i];
546  return std::string();
547  }
548 
549  virtual void set_arg_name(size_t i, const std::string& name) {
550  if ( i < 5+1 ) m_arg_names[i] = name;
551  }
552 
553  protected:
554 
555  std::string m_arg_names[5+1];
556 
557  sigc::slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> m_slot;
558 
559  };
560 
567  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
568  class Method <T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
569  : public MethodBase
570  {
571  public:
572 
573  typedef DBusCxxPointer<Method> pointer;
574 
575  Method(const std::string& name): MethodBase(name) { }
576 
577  virtual ~Method() { }
578 
579  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
580  CallMessage::const_pointer message );
581 
582  void set_method( sigc::slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> slot )
583  { m_slot = slot; }
584 
585  static pointer create(const std::string& name)
586  { return pointer( new Method(name) ); }
587 
589  { return MethodBase::pointer( new Method(this->name()) ); }
590 
592  virtual std::string introspect(int space_depth=0) const
593  {
594  std::ostringstream sout;
595  std::string spaces;
596  for (int i=0; i < space_depth; i++ ) spaces += " ";
597  sout << spaces << "<method name=\"" << name() << "\">\n";
598  T_return type;
599  sout << spaces << " <arg name=\"" << m_arg_names[0]
600  << "\" type=\"" << signature(type)
601  << "\" direction=\"out\"/>\n";
602  T_arg1 arg1;
603  sout << spaces << " <arg name=\"" << m_arg_names[1]
604  << "\" type=\"" << signature(arg1)
605  << "\" direction=\"in\"/>\n";
606  T_arg2 arg2;
607  sout << spaces << " <arg name=\"" << m_arg_names[2]
608  << "\" type=\"" << signature(arg2)
609  << "\" direction=\"in\"/>\n";
610  T_arg3 arg3;
611  sout << spaces << " <arg name=\"" << m_arg_names[3]
612  << "\" type=\"" << signature(arg3)
613  << "\" direction=\"in\"/>\n";
614  T_arg4 arg4;
615  sout << spaces << " <arg name=\"" << m_arg_names[4]
616  << "\" type=\"" << signature(arg4)
617  << "\" direction=\"in\"/>\n";
618  T_arg5 arg5;
619  sout << spaces << " <arg name=\"" << m_arg_names[5]
620  << "\" type=\"" << signature(arg5)
621  << "\" direction=\"in\"/>\n";
622  T_arg6 arg6;
623  sout << spaces << " <arg name=\"" << m_arg_names[6]
624  << "\" type=\"" << signature(arg6)
625  << "\" direction=\"in\"/>\n";
626  sout << spaces << "</method>\n";
627  return sout.str();
628  }
629 
630  virtual std::string arg_name(size_t i) {
631  if ( i < 6+1 ) return m_arg_names[i];
632  return std::string();
633  }
634 
635  virtual void set_arg_name(size_t i, const std::string& name) {
636  if ( i < 6+1 ) m_arg_names[i] = name;
637  }
638 
639  protected:
640 
641  std::string m_arg_names[6+1];
642 
643  sigc::slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> m_slot;
644 
645  };
646 
647 
648 
649 } /* namespace DBus */
650 
651 #include <dbus-cxx/connection.h>
652 
653 namespace DBus {
654 
655  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
657  {
658  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::handle_call_message method=" << m_name );
659 
660  if ( not connection or not message ) return NOT_HANDLED;
661 
662  T_return _retval;
663  T_arg1 _val_1;
664  T_arg2 _val_2;
665  T_arg3 _val_3;
666  T_arg4 _val_4;
667  T_arg5 _val_5;
668  T_arg6 _val_6;
669  T_arg7 _val_7;
670 
671  try {
672  Message::iterator i = message->begin();
673  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5 >> _val_6 >> _val_7;
674  }
675  catch ( ErrorInvalidTypecast& e ) {
676  return NOT_HANDLED;
677  }
678 
679  try {
680  _retval = m_slot(_val_1,_val_2,_val_3,_val_4,_val_5,_val_6,_val_7);
681  ReturnMessage::pointer retmsg = message->create_reply();
682 
683  if ( not retmsg ) return NOT_HANDLED;
684 
685  *retmsg << _retval;
686 
687  connection->send(retmsg);
688  }
689  catch ( const std::exception &e ) {
690  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
691 
692  if ( not errmsg ) return NOT_HANDLED;
693 
694  connection->send(errmsg);
695  }
696  catch ( ... ) {
697  std::ostringstream stream;
698  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
699  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
700  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
701 
702  if ( not errmsg ) return NOT_HANDLED;
703 
704  connection->send(errmsg);
705  }
706 
707  return HANDLED;
708  }
709 
710 
711 
712  template <class T_return>
714  {
715  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return>::handle_call_message method=" << m_name );
716 
717  if ( not connection or not message ) return NOT_HANDLED;
718 
719  T_return _retval;
720 
721 
722  try {
723  _retval = m_slot();
724  ReturnMessage::pointer retmsg = message->create_reply();
725 
726  if ( not retmsg ) return NOT_HANDLED;
727 
728  *retmsg << _retval;
729 
730  connection->send(retmsg);
731  }
732  catch ( const std::exception &e ) {
733  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
734 
735  if ( not errmsg ) return NOT_HANDLED;
736 
737  connection->send(errmsg);
738  }
739  catch ( ... ) {
740  std::ostringstream stream;
741  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
742  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
743  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
744 
745  if ( not errmsg ) return NOT_HANDLED;
746 
747  connection->send(errmsg);
748  }
749 
750  return HANDLED;
751  }
752 
753 
754  template <class T_return, class T_arg1>
756  {
757  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1>::handle_call_message method=" << m_name );
758 
759  if ( not connection or not message ) return NOT_HANDLED;
760 
761  T_return _retval;
762  T_arg1 _val_1;
763 
764  try {
765  Message::iterator i = message->begin();
766  i >> _val_1;
767  }
768  catch ( ErrorInvalidTypecast& e ) {
769  return NOT_HANDLED;
770  }
771 
772  try {
773  _retval = m_slot(_val_1);
774  ReturnMessage::pointer retmsg = message->create_reply();
775 
776  if ( not retmsg ) return NOT_HANDLED;
777 
778  *retmsg << _retval;
779 
780  connection->send(retmsg);
781  }
782  catch ( const std::exception &e ) {
783  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
784 
785  if ( not errmsg ) return NOT_HANDLED;
786 
787  connection->send(errmsg);
788  }
789  catch ( ... ) {
790  std::ostringstream stream;
791  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
792  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
793  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
794 
795  if ( not errmsg ) return NOT_HANDLED;
796 
797  connection->send(errmsg);
798  }
799 
800  return HANDLED;
801  }
802 
803 
804  template <class T_return, class T_arg1,class T_arg2>
806  {
807  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2>::handle_call_message method=" << m_name );
808 
809  if ( not connection or not message ) return NOT_HANDLED;
810 
811  T_return _retval;
812  T_arg1 _val_1;
813  T_arg2 _val_2;
814 
815  try {
816  Message::iterator i = message->begin();
817  i >> _val_1 >> _val_2;
818  }
819  catch ( ErrorInvalidTypecast& e ) {
820  return NOT_HANDLED;
821  }
822 
823  try {
824  _retval = m_slot(_val_1,_val_2);
825  ReturnMessage::pointer retmsg = message->create_reply();
826 
827  if ( not retmsg ) return NOT_HANDLED;
828 
829  *retmsg << _retval;
830 
831  connection->send(retmsg);
832  }
833  catch ( const std::exception &e ) {
834  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
835 
836  if ( not errmsg ) return NOT_HANDLED;
837 
838  connection->send(errmsg);
839  }
840  catch ( ... ) {
841  std::ostringstream stream;
842  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
843  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
844  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
845 
846  if ( not errmsg ) return NOT_HANDLED;
847 
848  connection->send(errmsg);
849  }
850 
851  return HANDLED;
852  }
853 
854 
855  template <class T_return, class T_arg1,class T_arg2,class T_arg3>
857  {
858  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2,T_arg3>::handle_call_message method=" << m_name );
859 
860  if ( not connection or not message ) return NOT_HANDLED;
861 
862  T_return _retval;
863  T_arg1 _val_1;
864  T_arg2 _val_2;
865  T_arg3 _val_3;
866 
867  try {
868  Message::iterator i = message->begin();
869  i >> _val_1 >> _val_2 >> _val_3;
870  }
871  catch ( ErrorInvalidTypecast& e ) {
872  return NOT_HANDLED;
873  }
874 
875  try {
876  _retval = m_slot(_val_1,_val_2,_val_3);
877  ReturnMessage::pointer retmsg = message->create_reply();
878 
879  if ( not retmsg ) return NOT_HANDLED;
880 
881  *retmsg << _retval;
882 
883  connection->send(retmsg);
884  }
885  catch ( const std::exception &e ) {
886  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
887 
888  if ( not errmsg ) return NOT_HANDLED;
889 
890  connection->send(errmsg);
891  }
892  catch ( ... ) {
893  std::ostringstream stream;
894  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
895  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
896  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
897 
898  if ( not errmsg ) return NOT_HANDLED;
899 
900  connection->send(errmsg);
901  }
902 
903  return HANDLED;
904  }
905 
906 
907  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
909  {
910  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2,T_arg3,T_arg4>::handle_call_message method=" << m_name );
911 
912  if ( not connection or not message ) return NOT_HANDLED;
913 
914  T_return _retval;
915  T_arg1 _val_1;
916  T_arg2 _val_2;
917  T_arg3 _val_3;
918  T_arg4 _val_4;
919 
920  try {
921  Message::iterator i = message->begin();
922  i >> _val_1 >> _val_2 >> _val_3 >> _val_4;
923  }
924  catch ( ErrorInvalidTypecast& e ) {
925  return NOT_HANDLED;
926  }
927 
928  try {
929  _retval = m_slot(_val_1,_val_2,_val_3,_val_4);
930  ReturnMessage::pointer retmsg = message->create_reply();
931 
932  if ( not retmsg ) return NOT_HANDLED;
933 
934  *retmsg << _retval;
935 
936  connection->send(retmsg);
937  }
938  catch ( const std::exception &e ) {
939  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
940 
941  if ( not errmsg ) return NOT_HANDLED;
942 
943  connection->send(errmsg);
944  }
945  catch ( ... ) {
946  std::ostringstream stream;
947  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
948  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
949  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
950 
951  if ( not errmsg ) return NOT_HANDLED;
952 
953  connection->send(errmsg);
954  }
955 
956  return HANDLED;
957  }
958 
959 
960  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
962  {
963  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::handle_call_message method=" << m_name );
964 
965  if ( not connection or not message ) return NOT_HANDLED;
966 
967  T_return _retval;
968  T_arg1 _val_1;
969  T_arg2 _val_2;
970  T_arg3 _val_3;
971  T_arg4 _val_4;
972  T_arg5 _val_5;
973 
974  try {
975  Message::iterator i = message->begin();
976  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5;
977  }
978  catch ( ErrorInvalidTypecast& e ) {
979  return NOT_HANDLED;
980  }
981 
982  try {
983  _retval = m_slot(_val_1,_val_2,_val_3,_val_4,_val_5);
984  ReturnMessage::pointer retmsg = message->create_reply();
985 
986  if ( not retmsg ) return NOT_HANDLED;
987 
988  *retmsg << _retval;
989 
990  connection->send(retmsg);
991  }
992  catch ( const std::exception &e ) {
993  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
994 
995  if ( not errmsg ) return NOT_HANDLED;
996 
997  connection->send(errmsg);
998  }
999  catch ( ... ) {
1000  std::ostringstream stream;
1001  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1002  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1003  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1004 
1005  if ( not errmsg ) return NOT_HANDLED;
1006 
1007  connection->send(errmsg);
1008  }
1009 
1010  return HANDLED;
1011  }
1012 
1013 
1014  template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
1016  {
1017  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::handle_call_message method=" << m_name );
1018 
1019  if ( not connection or not message ) return NOT_HANDLED;
1020 
1021  T_return _retval;
1022  T_arg1 _val_1;
1023  T_arg2 _val_2;
1024  T_arg3 _val_3;
1025  T_arg4 _val_4;
1026  T_arg5 _val_5;
1027  T_arg6 _val_6;
1028 
1029  try {
1030  Message::iterator i = message->begin();
1031  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5 >> _val_6;
1032  }
1033  catch ( ErrorInvalidTypecast& e ) {
1034  return NOT_HANDLED;
1035  }
1036 
1037  try {
1038  _retval = m_slot(_val_1,_val_2,_val_3,_val_4,_val_5,_val_6);
1039  ReturnMessage::pointer retmsg = message->create_reply();
1040 
1041  if ( not retmsg ) return NOT_HANDLED;
1042 
1043  *retmsg << _retval;
1044 
1045  connection->send(retmsg);
1046  }
1047  catch ( const std::exception &e ) {
1048  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1049 
1050  if ( not errmsg ) return NOT_HANDLED;
1051 
1052  connection->send(errmsg);
1053  }
1054  catch ( ... ) {
1055  std::ostringstream stream;
1056  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1057  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1058  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1059 
1060  if ( not errmsg ) return NOT_HANDLED;
1061 
1062  connection->send(errmsg);
1063  }
1064 
1065  return HANDLED;
1066  }
1067 
1068 
1069 
1076  template <>
1077  class Method <void, nil,nil,nil,nil,nil,nil,nil>
1078  : public MethodBase
1079  {
1080  public:
1081 
1082  typedef DBusCxxPointer<Method> pointer;
1083 
1084  Method(const std::string& name): MethodBase(name) { }
1085 
1086  virtual ~Method() { }
1087 
1088  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1089  CallMessage::const_pointer message )
1090  {
1091  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, >::handle_call_message method=" << m_name);
1092 
1093  if ( not connection or not message ) return NOT_HANDLED;
1094 
1095 
1096 
1097  try {
1098  m_slot();
1099  ReturnMessage::pointer retmsg = message->create_reply();
1100 
1101  if ( not retmsg ) return NOT_HANDLED;
1102 
1103 
1104  connection->send(retmsg);
1105  }
1106  catch ( const std::exception &e ) {
1107  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1108 
1109  if ( not errmsg ) return NOT_HANDLED;
1110 
1111  connection->send(errmsg);
1112  }
1113  catch ( ... ) {
1114  std::ostringstream stream;
1115  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1116  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1117  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1118 
1119  if ( not errmsg ) return NOT_HANDLED;
1120 
1121  connection->send(errmsg);
1122  }
1123 
1124  return HANDLED;
1125  }
1126 
1127 
1128 
1129  void set_method( sigc::slot0<void> slot )
1130  { m_slot = slot; }
1131 
1132  static pointer create(const std::string& name)
1133  { return pointer( new Method(name) ); }
1134 
1136  { return MethodBase::pointer( new Method(this->name()) ); }
1137 
1139  virtual std::string introspect(int space_depth=0) const
1140  {
1141  std::ostringstream sout;
1142  std::string spaces;
1143  for (int i=0; i < space_depth; i++ ) spaces += " ";
1144  sout << spaces << "<method name=\"" << name() << "\">\n";
1145  sout << spaces << "</method>\n";
1146  return sout.str();
1147  }
1148 
1149  virtual std::string arg_name(size_t i) {
1150  if ( i < 0+1 ) return m_arg_names[i];
1151  return std::string();
1152  }
1153 
1154  virtual void set_arg_name(size_t i, const std::string& name) {
1155  if ( i < 0+1 ) m_arg_names[i] = name;
1156  }
1157 
1158  protected:
1159 
1160  std::string m_arg_names[0+1];
1161 
1162  sigc::slot0<void> m_slot;
1163 
1164  };
1165 
1172  template <class T_arg1>
1173  class Method <void, T_arg1, nil,nil,nil,nil,nil,nil>
1174  : public MethodBase
1175  {
1176  public:
1177 
1178  typedef DBusCxxPointer<Method> pointer;
1179 
1180  Method(const std::string& name): MethodBase(name) { }
1181 
1182  virtual ~Method() { }
1183 
1184  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1185  CallMessage::const_pointer message )
1186  {
1187  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1>::handle_call_message method=" << m_name);
1188 
1189  if ( not connection or not message ) return NOT_HANDLED;
1190 
1191  T_arg1 _val_1;
1192 
1193  try {
1194  Message::iterator i = message->begin();
1195  i >> _val_1;
1196  }
1197  catch ( ErrorInvalidTypecast& e ) {
1198  return NOT_HANDLED;
1199  }
1200 
1201  try {
1202  m_slot(_val_1);
1203  ReturnMessage::pointer retmsg = message->create_reply();
1204 
1205  if ( not retmsg ) return NOT_HANDLED;
1206 
1207 
1208  connection->send(retmsg);
1209  }
1210  catch ( const std::exception &e ) {
1211  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1212 
1213  if ( not errmsg ) return NOT_HANDLED;
1214 
1215  connection->send(errmsg);
1216  }
1217  catch ( ... ) {
1218  std::ostringstream stream;
1219  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1220  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1221  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1222 
1223  if ( not errmsg ) return NOT_HANDLED;
1224 
1225  connection->send(errmsg);
1226  }
1227 
1228  return HANDLED;
1229  }
1230 
1231 
1232 
1233  void set_method( sigc::slot1<void, T_arg1> slot )
1234  { m_slot = slot; }
1235 
1236  static pointer create(const std::string& name)
1237  { return pointer( new Method(name) ); }
1238 
1240  { return MethodBase::pointer( new Method(this->name()) ); }
1241 
1243  virtual std::string introspect(int space_depth=0) const
1244  {
1245  std::ostringstream sout;
1246  std::string spaces;
1247  for (int i=0; i < space_depth; i++ ) spaces += " ";
1248  sout << spaces << "<method name=\"" << name() << "\">\n";
1249  T_arg1 arg1;
1250  sout << spaces << " <arg name=\"" << m_arg_names[1]
1251  << "\" type=\"" << signature(arg1)
1252  << "\" direction=\"in\"/>\n";
1253  sout << spaces << "</method>\n";
1254  return sout.str();
1255  }
1256 
1257  virtual std::string arg_name(size_t i) {
1258  if ( i < 1+1 ) return m_arg_names[i];
1259  return std::string();
1260  }
1261 
1262  virtual void set_arg_name(size_t i, const std::string& name) {
1263  if ( i < 1+1 ) m_arg_names[i] = name;
1264  }
1265 
1266  protected:
1267 
1268  std::string m_arg_names[1+1];
1269 
1270  sigc::slot1<void, T_arg1> m_slot;
1271 
1272  };
1273 
1280  template <class T_arg1,class T_arg2>
1281  class Method <void, T_arg1,T_arg2, nil,nil,nil,nil,nil>
1282  : public MethodBase
1283  {
1284  public:
1285 
1286  typedef DBusCxxPointer<Method> pointer;
1287 
1288  Method(const std::string& name): MethodBase(name) { }
1289 
1290  virtual ~Method() { }
1291 
1292  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1293  CallMessage::const_pointer message )
1294  {
1295  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2>::handle_call_message method=" << m_name);
1296 
1297  if ( not connection or not message ) return NOT_HANDLED;
1298 
1299  T_arg1 _val_1;
1300  T_arg2 _val_2;
1301 
1302  try {
1303  Message::iterator i = message->begin();
1304  i >> _val_1 >> _val_2;
1305  }
1306  catch ( ErrorInvalidTypecast& e ) {
1307  return NOT_HANDLED;
1308  }
1309 
1310  try {
1311  m_slot(_val_1,_val_2);
1312  ReturnMessage::pointer retmsg = message->create_reply();
1313 
1314  if ( not retmsg ) return NOT_HANDLED;
1315 
1316 
1317  connection->send(retmsg);
1318  }
1319  catch ( const std::exception &e ) {
1320  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1321 
1322  if ( not errmsg ) return NOT_HANDLED;
1323 
1324  connection->send(errmsg);
1325  }
1326  catch ( ... ) {
1327  std::ostringstream stream;
1328  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1329  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1330  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1331 
1332  if ( not errmsg ) return NOT_HANDLED;
1333 
1334  connection->send(errmsg);
1335  }
1336 
1337  return HANDLED;
1338  }
1339 
1340 
1341 
1342  void set_method( sigc::slot2<void, T_arg1,T_arg2> slot )
1343  { m_slot = slot; }
1344 
1345  static pointer create(const std::string& name)
1346  { return pointer( new Method(name) ); }
1347 
1349  { return MethodBase::pointer( new Method(this->name()) ); }
1350 
1352  virtual std::string introspect(int space_depth=0) const
1353  {
1354  std::ostringstream sout;
1355  std::string spaces;
1356  for (int i=0; i < space_depth; i++ ) spaces += " ";
1357  sout << spaces << "<method name=\"" << name() << "\">\n";
1358  T_arg1 arg1;
1359  sout << spaces << " <arg name=\"" << m_arg_names[1]
1360  << "\" type=\"" << signature(arg1)
1361  << "\" direction=\"in\"/>\n";
1362  T_arg2 arg2;
1363  sout << spaces << " <arg name=\"" << m_arg_names[2]
1364  << "\" type=\"" << signature(arg2)
1365  << "\" direction=\"in\"/>\n";
1366  sout << spaces << "</method>\n";
1367  return sout.str();
1368  }
1369 
1370  virtual std::string arg_name(size_t i) {
1371  if ( i < 2+1 ) return m_arg_names[i];
1372  return std::string();
1373  }
1374 
1375  virtual void set_arg_name(size_t i, const std::string& name) {
1376  if ( i < 2+1 ) m_arg_names[i] = name;
1377  }
1378 
1379  protected:
1380 
1381  std::string m_arg_names[2+1];
1382 
1383  sigc::slot2<void, T_arg1,T_arg2> m_slot;
1384 
1385  };
1386 
1393  template <class T_arg1,class T_arg2,class T_arg3>
1394  class Method <void, T_arg1,T_arg2,T_arg3, nil,nil,nil,nil>
1395  : public MethodBase
1396  {
1397  public:
1398 
1399  typedef DBusCxxPointer<Method> pointer;
1400 
1401  Method(const std::string& name): MethodBase(name) { }
1402 
1403  virtual ~Method() { }
1404 
1405  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1406  CallMessage::const_pointer message )
1407  {
1408  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2,T_arg3>::handle_call_message method=" << m_name);
1409 
1410  if ( not connection or not message ) return NOT_HANDLED;
1411 
1412  T_arg1 _val_1;
1413  T_arg2 _val_2;
1414  T_arg3 _val_3;
1415 
1416  try {
1417  Message::iterator i = message->begin();
1418  i >> _val_1 >> _val_2 >> _val_3;
1419  }
1420  catch ( ErrorInvalidTypecast& e ) {
1421  return NOT_HANDLED;
1422  }
1423 
1424  try {
1425  m_slot(_val_1,_val_2,_val_3);
1426  ReturnMessage::pointer retmsg = message->create_reply();
1427 
1428  if ( not retmsg ) return NOT_HANDLED;
1429 
1430 
1431  connection->send(retmsg);
1432  }
1433  catch ( const std::exception &e ) {
1434  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1435 
1436  if ( not errmsg ) return NOT_HANDLED;
1437 
1438  connection->send(errmsg);
1439  }
1440  catch ( ... ) {
1441  std::ostringstream stream;
1442  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1443  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1444  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1445 
1446  if ( not errmsg ) return NOT_HANDLED;
1447 
1448  connection->send(errmsg);
1449  }
1450 
1451  return HANDLED;
1452  }
1453 
1454 
1455 
1456  void set_method( sigc::slot3<void, T_arg1,T_arg2,T_arg3> slot )
1457  { m_slot = slot; }
1458 
1459  static pointer create(const std::string& name)
1460  { return pointer( new Method(name) ); }
1461 
1463  { return MethodBase::pointer( new Method(this->name()) ); }
1464 
1466  virtual std::string introspect(int space_depth=0) const
1467  {
1468  std::ostringstream sout;
1469  std::string spaces;
1470  for (int i=0; i < space_depth; i++ ) spaces += " ";
1471  sout << spaces << "<method name=\"" << name() << "\">\n";
1472  T_arg1 arg1;
1473  sout << spaces << " <arg name=\"" << m_arg_names[1]
1474  << "\" type=\"" << signature(arg1)
1475  << "\" direction=\"in\"/>\n";
1476  T_arg2 arg2;
1477  sout << spaces << " <arg name=\"" << m_arg_names[2]
1478  << "\" type=\"" << signature(arg2)
1479  << "\" direction=\"in\"/>\n";
1480  T_arg3 arg3;
1481  sout << spaces << " <arg name=\"" << m_arg_names[3]
1482  << "\" type=\"" << signature(arg3)
1483  << "\" direction=\"in\"/>\n";
1484  sout << spaces << "</method>\n";
1485  return sout.str();
1486  }
1487 
1488  virtual std::string arg_name(size_t i) {
1489  if ( i < 3+1 ) return m_arg_names[i];
1490  return std::string();
1491  }
1492 
1493  virtual void set_arg_name(size_t i, const std::string& name) {
1494  if ( i < 3+1 ) m_arg_names[i] = name;
1495  }
1496 
1497  protected:
1498 
1499  std::string m_arg_names[3+1];
1500 
1501  sigc::slot3<void, T_arg1,T_arg2,T_arg3> m_slot;
1502 
1503  };
1504 
1511  template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
1512  class Method <void, T_arg1,T_arg2,T_arg3,T_arg4, nil,nil,nil>
1513  : public MethodBase
1514  {
1515  public:
1516 
1517  typedef DBusCxxPointer<Method> pointer;
1518 
1519  Method(const std::string& name): MethodBase(name) { }
1520 
1521  virtual ~Method() { }
1522 
1523  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1524  CallMessage::const_pointer message )
1525  {
1526  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2,T_arg3,T_arg4>::handle_call_message method=" << m_name);
1527 
1528  if ( not connection or not message ) return NOT_HANDLED;
1529 
1530  T_arg1 _val_1;
1531  T_arg2 _val_2;
1532  T_arg3 _val_3;
1533  T_arg4 _val_4;
1534 
1535  try {
1536  Message::iterator i = message->begin();
1537  i >> _val_1 >> _val_2 >> _val_3 >> _val_4;
1538  }
1539  catch ( ErrorInvalidTypecast& e ) {
1540  return NOT_HANDLED;
1541  }
1542 
1543  try {
1544  m_slot(_val_1,_val_2,_val_3,_val_4);
1545  ReturnMessage::pointer retmsg = message->create_reply();
1546 
1547  if ( not retmsg ) return NOT_HANDLED;
1548 
1549 
1550  connection->send(retmsg);
1551  }
1552  catch ( const std::exception &e ) {
1553  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1554 
1555  if ( not errmsg ) return NOT_HANDLED;
1556 
1557  connection->send(errmsg);
1558  }
1559  catch ( ... ) {
1560  std::ostringstream stream;
1561  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1562  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1563  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1564 
1565  if ( not errmsg ) return NOT_HANDLED;
1566 
1567  connection->send(errmsg);
1568  }
1569 
1570  return HANDLED;
1571  }
1572 
1573 
1574 
1575  void set_method( sigc::slot4<void, T_arg1,T_arg2,T_arg3,T_arg4> slot )
1576  { m_slot = slot; }
1577 
1578  static pointer create(const std::string& name)
1579  { return pointer( new Method(name) ); }
1580 
1582  { return MethodBase::pointer( new Method(this->name()) ); }
1583 
1585  virtual std::string introspect(int space_depth=0) const
1586  {
1587  std::ostringstream sout;
1588  std::string spaces;
1589  for (int i=0; i < space_depth; i++ ) spaces += " ";
1590  sout << spaces << "<method name=\"" << name() << "\">\n";
1591  T_arg1 arg1;
1592  sout << spaces << " <arg name=\"" << m_arg_names[1]
1593  << "\" type=\"" << signature(arg1)
1594  << "\" direction=\"in\"/>\n";
1595  T_arg2 arg2;
1596  sout << spaces << " <arg name=\"" << m_arg_names[2]
1597  << "\" type=\"" << signature(arg2)
1598  << "\" direction=\"in\"/>\n";
1599  T_arg3 arg3;
1600  sout << spaces << " <arg name=\"" << m_arg_names[3]
1601  << "\" type=\"" << signature(arg3)
1602  << "\" direction=\"in\"/>\n";
1603  T_arg4 arg4;
1604  sout << spaces << " <arg name=\"" << m_arg_names[4]
1605  << "\" type=\"" << signature(arg4)
1606  << "\" direction=\"in\"/>\n";
1607  sout << spaces << "</method>\n";
1608  return sout.str();
1609  }
1610 
1611  virtual std::string arg_name(size_t i) {
1612  if ( i < 4+1 ) return m_arg_names[i];
1613  return std::string();
1614  }
1615 
1616  virtual void set_arg_name(size_t i, const std::string& name) {
1617  if ( i < 4+1 ) m_arg_names[i] = name;
1618  }
1619 
1620  protected:
1621 
1622  std::string m_arg_names[4+1];
1623 
1624  sigc::slot4<void, T_arg1,T_arg2,T_arg3,T_arg4> m_slot;
1625 
1626  };
1627 
1634  template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
1635  class Method <void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil,nil>
1636  : public MethodBase
1637  {
1638  public:
1639 
1640  typedef DBusCxxPointer<Method> pointer;
1641 
1642  Method(const std::string& name): MethodBase(name) { }
1643 
1644  virtual ~Method() { }
1645 
1646  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1647  CallMessage::const_pointer message )
1648  {
1649  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>::handle_call_message method=" << m_name);
1650 
1651  if ( not connection or not message ) return NOT_HANDLED;
1652 
1653  T_arg1 _val_1;
1654  T_arg2 _val_2;
1655  T_arg3 _val_3;
1656  T_arg4 _val_4;
1657  T_arg5 _val_5;
1658 
1659  try {
1660  Message::iterator i = message->begin();
1661  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5;
1662  }
1663  catch ( ErrorInvalidTypecast& e ) {
1664  return NOT_HANDLED;
1665  }
1666 
1667  try {
1668  m_slot(_val_1,_val_2,_val_3,_val_4,_val_5);
1669  ReturnMessage::pointer retmsg = message->create_reply();
1670 
1671  if ( not retmsg ) return NOT_HANDLED;
1672 
1673 
1674  connection->send(retmsg);
1675  }
1676  catch ( const std::exception &e ) {
1677  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1678 
1679  if ( not errmsg ) return NOT_HANDLED;
1680 
1681  connection->send(errmsg);
1682  }
1683  catch ( ... ) {
1684  std::ostringstream stream;
1685  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1686  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1687  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1688 
1689  if ( not errmsg ) return NOT_HANDLED;
1690 
1691  connection->send(errmsg);
1692  }
1693 
1694  return HANDLED;
1695  }
1696 
1697 
1698 
1699  void set_method( sigc::slot5<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> slot )
1700  { m_slot = slot; }
1701 
1702  static pointer create(const std::string& name)
1703  { return pointer( new Method(name) ); }
1704 
1706  { return MethodBase::pointer( new Method(this->name()) ); }
1707 
1709  virtual std::string introspect(int space_depth=0) const
1710  {
1711  std::ostringstream sout;
1712  std::string spaces;
1713  for (int i=0; i < space_depth; i++ ) spaces += " ";
1714  sout << spaces << "<method name=\"" << name() << "\">\n";
1715  T_arg1 arg1;
1716  sout << spaces << " <arg name=\"" << m_arg_names[1]
1717  << "\" type=\"" << signature(arg1)
1718  << "\" direction=\"in\"/>\n";
1719  T_arg2 arg2;
1720  sout << spaces << " <arg name=\"" << m_arg_names[2]
1721  << "\" type=\"" << signature(arg2)
1722  << "\" direction=\"in\"/>\n";
1723  T_arg3 arg3;
1724  sout << spaces << " <arg name=\"" << m_arg_names[3]
1725  << "\" type=\"" << signature(arg3)
1726  << "\" direction=\"in\"/>\n";
1727  T_arg4 arg4;
1728  sout << spaces << " <arg name=\"" << m_arg_names[4]
1729  << "\" type=\"" << signature(arg4)
1730  << "\" direction=\"in\"/>\n";
1731  T_arg5 arg5;
1732  sout << spaces << " <arg name=\"" << m_arg_names[5]
1733  << "\" type=\"" << signature(arg5)
1734  << "\" direction=\"in\"/>\n";
1735  sout << spaces << "</method>\n";
1736  return sout.str();
1737  }
1738 
1739  virtual std::string arg_name(size_t i) {
1740  if ( i < 5+1 ) return m_arg_names[i];
1741  return std::string();
1742  }
1743 
1744  virtual void set_arg_name(size_t i, const std::string& name) {
1745  if ( i < 5+1 ) m_arg_names[i] = name;
1746  }
1747 
1748  protected:
1749 
1750  std::string m_arg_names[5+1];
1751 
1752  sigc::slot5<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> m_slot;
1753 
1754  };
1755 
1762  template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
1763  class Method <void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
1764  : public MethodBase
1765  {
1766  public:
1767 
1768  typedef DBusCxxPointer<Method> pointer;
1769 
1770  Method(const std::string& name): MethodBase(name) { }
1771 
1772  virtual ~Method() { }
1773 
1774  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1775  CallMessage::const_pointer message )
1776  {
1777  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>::handle_call_message method=" << m_name);
1778 
1779  if ( not connection or not message ) return NOT_HANDLED;
1780 
1781  T_arg1 _val_1;
1782  T_arg2 _val_2;
1783  T_arg3 _val_3;
1784  T_arg4 _val_4;
1785  T_arg5 _val_5;
1786  T_arg6 _val_6;
1787 
1788  try {
1789  Message::iterator i = message->begin();
1790  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5 >> _val_6;
1791  }
1792  catch ( ErrorInvalidTypecast& e ) {
1793  return NOT_HANDLED;
1794  }
1795 
1796  try {
1797  m_slot(_val_1,_val_2,_val_3,_val_4,_val_5,_val_6);
1798  ReturnMessage::pointer retmsg = message->create_reply();
1799 
1800  if ( not retmsg ) return NOT_HANDLED;
1801 
1802 
1803  connection->send(retmsg);
1804  }
1805  catch ( const std::exception &e ) {
1806  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1807 
1808  if ( not errmsg ) return NOT_HANDLED;
1809 
1810  connection->send(errmsg);
1811  }
1812  catch ( ... ) {
1813  std::ostringstream stream;
1814  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1815  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1816  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1817 
1818  if ( not errmsg ) return NOT_HANDLED;
1819 
1820  connection->send(errmsg);
1821  }
1822 
1823  return HANDLED;
1824  }
1825 
1826 
1827 
1828  void set_method( sigc::slot6<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> slot )
1829  { m_slot = slot; }
1830 
1831  static pointer create(const std::string& name)
1832  { return pointer( new Method(name) ); }
1833 
1835  { return MethodBase::pointer( new Method(this->name()) ); }
1836 
1838  virtual std::string introspect(int space_depth=0) const
1839  {
1840  std::ostringstream sout;
1841  std::string spaces;
1842  for (int i=0; i < space_depth; i++ ) spaces += " ";
1843  sout << spaces << "<method name=\"" << name() << "\">\n";
1844  T_arg1 arg1;
1845  sout << spaces << " <arg name=\"" << m_arg_names[1]
1846  << "\" type=\"" << signature(arg1)
1847  << "\" direction=\"in\"/>\n";
1848  T_arg2 arg2;
1849  sout << spaces << " <arg name=\"" << m_arg_names[2]
1850  << "\" type=\"" << signature(arg2)
1851  << "\" direction=\"in\"/>\n";
1852  T_arg3 arg3;
1853  sout << spaces << " <arg name=\"" << m_arg_names[3]
1854  << "\" type=\"" << signature(arg3)
1855  << "\" direction=\"in\"/>\n";
1856  T_arg4 arg4;
1857  sout << spaces << " <arg name=\"" << m_arg_names[4]
1858  << "\" type=\"" << signature(arg4)
1859  << "\" direction=\"in\"/>\n";
1860  T_arg5 arg5;
1861  sout << spaces << " <arg name=\"" << m_arg_names[5]
1862  << "\" type=\"" << signature(arg5)
1863  << "\" direction=\"in\"/>\n";
1864  T_arg6 arg6;
1865  sout << spaces << " <arg name=\"" << m_arg_names[6]
1866  << "\" type=\"" << signature(arg6)
1867  << "\" direction=\"in\"/>\n";
1868  sout << spaces << "</method>\n";
1869  return sout.str();
1870  }
1871 
1872  virtual std::string arg_name(size_t i) {
1873  if ( i < 6+1 ) return m_arg_names[i];
1874  return std::string();
1875  }
1876 
1877  virtual void set_arg_name(size_t i, const std::string& name) {
1878  if ( i < 6+1 ) m_arg_names[i] = name;
1879  }
1880 
1881  protected:
1882 
1883  std::string m_arg_names[6+1];
1884 
1885  sigc::slot6<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> m_slot;
1886 
1887  };
1888 
1895  template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
1896  class Method <void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
1897  : public MethodBase
1898  {
1899  public:
1900 
1901  typedef DBusCxxPointer<Method> pointer;
1902 
1903  Method(const std::string& name): MethodBase(name) { }
1904 
1905  virtual ~Method() { }
1906 
1907  virtual HandlerResult handle_call_message( DBusCxxPointer<Connection> connection,
1908  CallMessage::const_pointer message )
1909  {
1910  DBUSCXX_DEBUG_STDSTR("dbus.Method", "Method<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>::handle_call_message method=" << m_name);
1911 
1912  if ( not connection or not message ) return NOT_HANDLED;
1913 
1914  T_arg1 _val_1;
1915  T_arg2 _val_2;
1916  T_arg3 _val_3;
1917  T_arg4 _val_4;
1918  T_arg5 _val_5;
1919  T_arg6 _val_6;
1920  T_arg7 _val_7;
1921 
1922  try {
1923  Message::iterator i = message->begin();
1924  i >> _val_1 >> _val_2 >> _val_3 >> _val_4 >> _val_5 >> _val_6 >> _val_7;
1925  }
1926  catch ( ErrorInvalidTypecast& e ) {
1927  return NOT_HANDLED;
1928  }
1929 
1930  try {
1931  m_slot(_val_1,_val_2,_val_3,_val_4,_val_5,_val_6,_val_7);
1932  ReturnMessage::pointer retmsg = message->create_reply();
1933 
1934  if ( not retmsg ) return NOT_HANDLED;
1935 
1936 
1937  connection->send(retmsg);
1938  }
1939  catch ( const std::exception &e ) {
1940  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, e.what() );
1941 
1942  if ( not errmsg ) return NOT_HANDLED;
1943 
1944  connection->send(errmsg);
1945  }
1946  catch ( ... ) {
1947  std::ostringstream stream;
1948  stream << "DBus-cxx " << DBUS_CXX_PACKAGE_MAJOR_VERSION << "." <<
1949  DBUS_CXX_PACKAGE_MINOR_VERSION << "." << DBUS_CXX_PACKAGE_MICRO_VERSION << " unknown error.";
1950  ErrorMessage::pointer errmsg = ErrorMessage::create( message, DBUS_ERROR_FAILED, stream.str() );
1951 
1952  if ( not errmsg ) return NOT_HANDLED;
1953 
1954  connection->send(errmsg);
1955  }
1956 
1957  return HANDLED;
1958  }
1959 
1960 
1961 
1962  void set_method( sigc::slot7<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> slot )
1963  { m_slot = slot; }
1964 
1965  static pointer create(const std::string& name)
1966  { return pointer( new Method(name) ); }
1967 
1969  { return MethodBase::pointer( new Method(this->name()) ); }
1970 
1972  virtual std::string introspect(int space_depth=0) const
1973  {
1974  std::ostringstream sout;
1975  std::string spaces;
1976  for (int i=0; i < space_depth; i++ ) spaces += " ";
1977  sout << spaces << "<method name=\"" << name() << "\">\n";
1978  T_arg1 arg1;
1979  sout << spaces << " <arg name=\"" << m_arg_names[1]
1980  << "\" type=\"" << signature(arg1)
1981  << "\" direction=\"in\"/>\n";
1982  T_arg2 arg2;
1983  sout << spaces << " <arg name=\"" << m_arg_names[2]
1984  << "\" type=\"" << signature(arg2)
1985  << "\" direction=\"in\"/>\n";
1986  T_arg3 arg3;
1987  sout << spaces << " <arg name=\"" << m_arg_names[3]
1988  << "\" type=\"" << signature(arg3)
1989  << "\" direction=\"in\"/>\n";
1990  T_arg4 arg4;
1991  sout << spaces << " <arg name=\"" << m_arg_names[4]
1992  << "\" type=\"" << signature(arg4)
1993  << "\" direction=\"in\"/>\n";
1994  T_arg5 arg5;
1995  sout << spaces << " <arg name=\"" << m_arg_names[5]
1996  << "\" type=\"" << signature(arg5)
1997  << "\" direction=\"in\"/>\n";
1998  T_arg6 arg6;
1999  sout << spaces << " <arg name=\"" << m_arg_names[6]
2000  << "\" type=\"" << signature(arg6)
2001  << "\" direction=\"in\"/>\n";
2002  T_arg7 arg7;
2003  sout << spaces << " <arg name=\"" << m_arg_names[7]
2004  << "\" type=\"" << signature(arg7)
2005  << "\" direction=\"in\"/>\n";
2006  sout << spaces << "</method>\n";
2007  return sout.str();
2008  }
2009 
2010  virtual std::string arg_name(size_t i) {
2011  if ( i < 7+1 ) return m_arg_names[i];
2012  return std::string();
2013  }
2014 
2015  virtual void set_arg_name(size_t i, const std::string& name) {
2016  if ( i < 7+1 ) m_arg_names[i] = name;
2017  }
2018 
2019  protected:
2020 
2021  std::string m_arg_names[7+1];
2022 
2023  sigc::slot7<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> m_slot;
2024 
2025  };
2026 
2027 
2028 
2029 } /* namespace DBus */
2030 
2031 
2032 #endif /* DBUS_CXX_METHOD_H */
2033 
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:389
virtual std::string arg_name(size_t i)
Definition: method.h:1149
sigc::slot1< T_return, T_arg1 > m_slot
Definition: method.h:253
void set_method(sigc::slot2< T_return, T_arg1, T_arg2 > slot)
Definition: method.h:278
sigc::slot5< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > m_slot
Definition: method.h:1752
static pointer create(const std::string &name)
Definition: method.h:281
Method(const std::string &name)
Definition: method.h:1903
virtual std::string arg_name(size_t i)
Definition: method.h:1872
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:2015
sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > m_slot
Definition: method.h:475
static pointer create(const std::string &name)
Definition: method.h:585
virtual MethodBase::pointer clone()
Definition: method.h:1239
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:245
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1184
void set_method(sigc::slot1< T_return, T_arg1 > slot)
Definition: method.h:212
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:549
Method(const std::string &name)
Definition: method.h:493
static pointer create(const std::string &name)
Definition: method.h:153
DBusCxxPointer< Method > pointer
Definition: method.h:203
void set_method(sigc::slot2< void, T_arg1, T_arg2 > slot)
Definition: method.h:1342
virtual std::string arg_name(size_t i)
Definition: method.h:2010
static pointer create(const std::string &name)
Definition: method.h:351
DBusCxxPointer< Method > pointer
Definition: method.h:1517
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1744
HandlerResult
Definition: enums.h:87
void set_method(sigc::slot4< T_return, T_arg1, T_arg2, T_arg3, T_arg4 > slot)
Definition: method.h:422
sigc::slot3< void, T_arg1, T_arg2, T_arg3 > m_slot
Definition: method.h:1501
sigc::nil nil
Definition: types.h:36
const std::string & name() const
Definition: methodbase.cpp:42
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1709
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1907
static pointer create(const std::string &name)
Definition: method.h:503
virtual std::string arg_name(size_t i)
Definition: method.h:174
Method(const std::string &name)
Definition: method.h:52
std::string m_arg_names[7+1]
Definition: method.h:122
Definition: accumulators.h:24
Method(const std::string &name)
Definition: method.h:1180
#define DBUSCXX_DEBUG_STDSTR(logger, message)
Definition: headerlog.h:38
virtual MethodBase::pointer clone()
Definition: method.h:1462
virtual std::string arg_name(size_t i)
Definition: method.h:1488
DBusCxxPointer< Method > pointer
Definition: method.h:50
static pointer create(const std::string &name)
Definition: method.h:1578
DBusCxxPointer< ErrorMessage > pointer
Definition: errormessage.h:51
static pointer create(const std::string &name)
Definition: method.h:1831
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:467
sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > m_slot
Definition: method.h:557
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1616
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1139
DBusCxxPointer< Method > pointer
Definition: method.h:491
Definition: enums.h:90
virtual std::string arg_name(size_t i)
Definition: method.h:111
virtual MethodBase::pointer clone()
Definition: method.h:506
virtual std::string arg_name(size_t i)
Definition: method.h:310
void set_method(sigc::slot7< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > slot)
Definition: method.h:1962
void set_method(sigc::slot5< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > slot)
Definition: method.h:500
Method(const std::string &name)
Definition: method.h:1642
sigc::slot2< T_return, T_arg1, T_arg2 > m_slot
Definition: method.h:323
virtual std::string arg_name(size_t i)
Definition: method.h:240
Method(const std::string &name)
Definition: method.h:341
Definition: methodbase.h:39
virtual MethodBase::pointer clone()
Definition: method.h:1705
DBusCxxPointer< Method > pointer
Definition: method.h:413
sigc::slot1< void, T_arg1 > m_slot
Definition: method.h:1270
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1154
virtual MethodBase::pointer clone()
Definition: method.h:1834
sigc::slot2< void, T_arg1, T_arg2 > m_slot
Definition: method.h:1383
sigc::slot0< void > m_slot
Definition: method.h:1162
DBusCxxPointer< Method > pointer
Definition: method.h:1640
DBusCxxPointer< Method > pointer
Definition: method.h:1082
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:315
virtual std::string arg_name(size_t i)
Definition: method.h:1739
virtual MethodBase::pointer clone()
Definition: method.h:354
static pointer create()
Definition: errormessage.cpp:65
DBusCxxPointer< Method > pointer
Definition: method.h:1901
virtual MethodBase::pointer clone()
Definition: method.h:428
virtual MethodBase::pointer clone()
Definition: method.h:1135
virtual ~Method()
Definition: method.h:54
void set_method(sigc::slot5< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5 > slot)
Definition: method.h:1699
sigc::slot0< T_return > m_slot
Definition: method.h:187
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:592
Definition: forward_decls.h:45
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1838
Method(const std::string &name)
Definition: method.h:1084
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1466
virtual std::string arg_name(size_t i)
Definition: method.h:544
Method(const std::string &name)
Definition: method.h:1770
DBusCxxPointer< Method > pointer
Definition: method.h:1286
DBusCxxPointer< Method > pointer
Definition: method.h:269
static pointer create(const std::string &name)
Definition: method.h:1702
sigc::slot4< void, T_arg1, T_arg2, T_arg3, T_arg4 > m_slot
Definition: method.h:1624
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1972
sigc::slot6< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > m_slot
Definition: method.h:1885
#define DBUS_CXX_PACKAGE_MICRO_VERSION
Definition: dbus-cxx-config.h:145
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:160
static pointer create(const std::string &name)
Definition: method.h:1459
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:510
DBusCxxPointer< Method > pointer
Definition: method.h:1768
virtual std::string arg_name(size_t i)
Definition: method.h:630
DBusCxxPointer< Method > pointer
Definition: method.h:339
DBusCxxPointer< Method > pointer
Definition: method.h:141
#define DBUS_CXX_PACKAGE_MAJOR_VERSION
Definition: dbus-cxx-config.h:140
static pointer create(const std::string &name)
Definition: method.h:425
virtual MethodBase::pointer clone()
Definition: method.h:65
void set_method(sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > slot)
Definition: method.h:582
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:222
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1088
Method(const std::string &name)
Definition: method.h:1288
DBusCxxPointer< Method > pointer
Definition: method.h:1399
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1646
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:656
virtual std::string arg_name(size_t i)
Definition: method.h:1611
Method(const std::string &name)
Definition: method.h:1519
static pointer create(const std::string &name)
Definition: method.h:1345
DBusCxxPointer< Method > pointer
Definition: method.h:1178
virtual MethodBase::pointer clone()
Definition: method.h:588
sigc::slot7< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > m_slot
Definition: method.h:2023
virtual MethodBase::pointer clone()
Definition: method.h:156
virtual std::string arg_name(size_t i)
Definition: method.h:384
#define DBUS_CXX_PACKAGE_MINOR_VERSION
Definition: dbus-cxx-config.h:150
std::string m_name
Definition: methodbase.h:76
Method(const std::string &name)
Definition: method.h:415
void set_method(sigc::slot1< void, T_arg1 > slot)
Definition: method.h:1233
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1877
virtual std::string arg_name(size_t i)
Definition: method.h:462
virtual MethodBase::pointer clone()
Definition: method.h:1968
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:432
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1493
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:116
static pointer create(const std::string &name)
Definition: method.h:215
sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > m_slot
Definition: method.h:124
sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > m_slot
Definition: method.h:397
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1405
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1523
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:288
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:635
DBusCxxPointer< ReturnMessage > pointer
Definition: returnmessage.h:52
virtual MethodBase::pointer clone()
Definition: method.h:284
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:179
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1292
virtual std::string arg_name(size_t i)
Definition: method.h:1257
void set_method(sigc::slot3< void, T_arg1, T_arg2, T_arg3 > slot)
Definition: method.h:1456
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1243
Method(const std::string &name)
Definition: method.h:1401
Type type(uint8_t)
Definition: types.h:38
virtual MethodBase::pointer clone()
Definition: method.h:1581
virtual MethodBase::pointer clone()
Definition: method.h:1348
static pointer create(const std::string &name)
Definition: method.h:1132
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1585
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1375
std::string signature(uint8_t &)
Definition: signature.h:94
static pointer create(const std::string &name)
Definition: method.h:62
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:69
Method(const std::string &name)
Definition: method.h:271
static pointer create(const std::string &name)
Definition: method.h:1965
Extraction iterator allowing values to be retrieved from a message.
Definition: messageiterator.h:37
virtual MethodBase::pointer clone()
Definition: method.h:218
virtual HandlerResult handle_call_message(DBusCxxPointer< Connection > connection, CallMessage::const_pointer message)
Definition: method.h:1774
void set_method(sigc::slot7< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7 > slot)
Definition: method.h:59
void set_method(sigc::slot4< void, T_arg1, T_arg2, T_arg3, T_arg4 > slot)
Definition: method.h:1575
sigc::slot6< T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > m_slot
Definition: method.h:643
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:1352
Method(const std::string &name)
Definition: method.h:143
void set_method(sigc::slot3< T_return, T_arg1, T_arg2, T_arg3 > slot)
Definition: method.h:348
Definition: enums.h:89
DBusCxxPointer< MethodBase > pointer
Definition: methodbase.h:49
void set_method(sigc::slot6< void, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6 > slot)
Definition: method.h:1828
DBusCxxPointer< const CallMessage > const_pointer
Definition: callmessage.h:59
void set_method(sigc::slot0< T_return > slot)
Definition: method.h:150
virtual std::string introspect(int space_depth=0) const
Returns a DBus XML description of this interface.
Definition: method.h:358
Method(const std::string &name)
Definition: method.h:205
void set_method(sigc::slot0< void > slot)
Definition: method.h:1129
virtual std::string arg_name(size_t i)
Definition: method.h:1370
virtual void set_arg_name(size_t i, const std::string &name)
Definition: method.h:1262
static pointer create(const std::string &name)
Definition: method.h:1236

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8