| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

Property.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_PROPERTY_H
2 #define GAUDIKERNEL_PROPERTY_H
3 // ============================================================================
4 // STD & STL
5 // ============================================================================
6 #include <string>
7 #include <stdexcept>
8 #include <typeinfo>
9 // ============================================================================
10 // Application C++ Class Headers
11 // ============================================================================
12 #include "GaudiKernel/Kernel.h"
13 #include "GaudiKernel/PropertyVerifier.h"
14 #include "GaudiKernel/Parsers.h"
15 #include "GaudiKernel/ToStream.h"
16 #include "GaudiKernel/SmartIF.h"
17 // ============================================================================
18
19 // ============================================================================
20 class Property ;
21 class IProperty ;
22 class IInterface ;
23 // ============================================================================
24
25 // ============================================================================
27 // ============================================================================
28 GAUDI_API std::ostream& operator<<(std::ostream& stream, const Property& prop);
29 // ============================================================================
38 class GAUDI_API Property
39 {
40 private:
41 // the default constructor is disabled
42 Property();
43 public:
45 const std::string& name () const { return m_name ; }
47 const std::string& documentation() const { return m_documentation; }
49 const std::type_info* type_info () const { return m_typeinfo ; }
51 std::string type () const { return m_typeinfo->name() ; }
53 virtual bool load ( Property& dest ) const = 0 ;
55 virtual bool assign ( const Property& source ) = 0 ;
56 public:
58 virtual std::string toString () const = 0 ;
60 virtual void toStream(std::ostream& out) const = 0;
62 virtual StatusCode fromString ( const std::string& value ) = 0 ;
63 public:
65 const std::function<void(Property&)>& readCallBack() const { return m_readCallBack; }
67 const std::function<void(Property&)>& updateCallBack() const { return m_updateCallBack; }
68
70 virtual Property& declareReadHandler ( std::function<void(Property&)> fun ) ;
72 virtual Property& declareUpdateHandler ( std::function<void(Property&)> fun ) ;
73
74 template< class HT >
75 inline Property& declareReadHandler( void ( HT::* MF ) ( Property& ) , HT* instance )
76 { return declareReadHandler( [=](Property& p) { (instance->*MF)(p); } ) ; }
77
78 template< class HT >
79 inline Property& declareUpdateHandler( void ( HT::* MF ) ( Property& ) , HT* instance )
80 { return declareUpdateHandler ( [=](Property& p) { (instance->*MF)(p); } ); }
81
83 virtual void useReadHandler () const ;
85 virtual bool useUpdateHandler () ;
86 public:
88 virtual ~Property() = default;
90 virtual Property* clone () const = 0 ;
92 void setName ( std::string value ) { m_name = std::move(value) ; }
94 void setDocumentation( std::string documentation ) {
95 m_documentation = std::move(documentation); }
97 virtual std::ostream& fillStream ( std::ostream& ) const ;
98 protected:
100 Property
101 ( const std::type_info& type ,
102 std::string name = "" ) ;
104 Property
105 ( std::string name ,
106 const std::type_info& type ) ;
108 Property ( const Property& ) = default;
110 Property& operator=( const Property& ) = default;
111 private:
112 // property name
113 std::string m_name ;
114 // property doc string
115 std::string m_documentation;
116 // property type
117 const std::type_info* m_typeinfo ;
118 protected:
119 // call back functor for reading
120 mutable std::function<void(Property&)> m_readCallBack;
121 // call back functor for update
122 std::function<void(Property&)> m_updateCallBack;
123 };
124 // ============================================================================
132 // ============================================================================
133 template <class TYPE>
134 class PropertyWithValue : public Property
135 {
136 public:
137 // ==========================================================================
139 typedef Gaudi::Utils::PropertyTypeTraits<TYPE> Traits ;
141 typedef typename Traits::PVal PVal ;
142 // ==========================================================================
143 protected:
144 // ==========================================================================
146 inline PropertyWithValue
147 ( std::string name ,
148 PVal value ,
149 const bool owner ) ;
151 inline PropertyWithValue ( const PropertyWithValue& rhs ) ;
153 template <class OTHER>
154 inline PropertyWithValue ( const PropertyWithValue<OTHER>& right ) ;
156 ~PropertyWithValue() override ;
158 PropertyWithValue& operator=( const TYPE& value ) ;
159 // assignment operator (don't let the compiler generate a buggy one)
160 PropertyWithValue& operator=( const PropertyWithValue& rhs ) ;
161 // assignment operator
162 template <class OTHER>
163 PropertyWithValue& operator=( const PropertyWithValue<OTHER>& right ) ;
164 // ==========================================================================
165 public:
166 // ==========================================================================
168 operator const TYPE& () const { return value() ;}
170 inline const TYPE& value() const ;
171 // ==========================================================================
172 public:
173 // ==========================================================================
175 virtual bool setValue ( const TYPE& value ) = 0 ;
177 bool assign ( const Property& source ) override;
179 bool load ( Property& dest ) const override;
181 StatusCode fromString ( const std::string& s ) override;
183 std::string toString () const override;
185 void toStream (std::ostream& out) const override;
186 // ==========================================================================
187 protected:
188 // ==========================================================================
190 inline void i_set ( const TYPE& value ) {
191 Traits::assign(*m_value, value);
192 }
194 inline PVal i_get () const {
195 return m_value;
196 }
197 // ==========================================================================
198 private:
199 // ==========================================================================
201 PVal m_value ; // the actual property value
203 bool m_own ; // owner of the storage
204 // ==========================================================================
205 };
206
207 // ============================================================================
209 // ============================================================================
210 template <class TYPE>
211 inline
212 PropertyWithValue<TYPE>::PropertyWithValue
213 ( std::string name ,
214 PVal value ,
215 const bool own )
216 : Property ( typeid( TYPE ) , std::move(name) )
217 , m_value ( value )
218 , m_own ( own )
219 {}
220 // ============================================================================
221 // copy constructor
222 // ============================================================================
223 template <class TYPE>
224 inline PropertyWithValue<TYPE>::PropertyWithValue
225 ( const PropertyWithValue& right )
226 : Property( right )
227 , m_value ( right.m_value )
228 , m_own ( right.m_own )
229 {
230 m_value = Traits::copy ( right.value() , m_own ) ;
231 }
232 // ============================================================================
233 // "copy" constructor form any other type
234 // ============================================================================
235 template <class TYPE>
236 template <class OTHER>
237 inline PropertyWithValue<TYPE>::PropertyWithValue
238 ( const PropertyWithValue<OTHER>& right )
239 : Property( right )
240 , m_value ( right.m_value )
241 , m_own ( right.m_own )
242 {
243 m_value = Traits::copy ( right.value() , m_own ) ;
244 }
245 // ============================================================================
247 // ============================================================================
248 template <class TYPE>
249 inline PropertyWithValue<TYPE>::~PropertyWithValue()
250 {
251 Traits::dele ( m_value , m_own ) ;
252 }
253 // ============================================================================
255 // ============================================================================
256 template <class TYPE>
257 inline PropertyWithValue<TYPE>&
258 PropertyWithValue<TYPE>::operator=( const TYPE& value )
259 {
260 if ( !setValue ( value ) )
261 { throw std::out_of_range( "Value not verified" ) ; }
262 return *this ;
263 }
264 // ============================================================================
266 // ============================================================================
267 template <class TYPE>
268 inline bool
269 PropertyWithValue<TYPE>::assign ( const Property& source )
270 {
271 // 1) Is the property of "the same" type?
272 const PropertyWithValue<TYPE>* p =
273 dynamic_cast<const PropertyWithValue<TYPE>*> ( &source ) ;
274 if ( p ) { return setValue ( p->value() ) ; } // RETURN
275 // 2) Else use the string representation
276 return this->fromString( source.toString() ).isSuccess() ;
277 }
278 // ============================================================================
280 // ============================================================================
281 template <class TYPE>
282 inline bool
283 PropertyWithValue<TYPE>::load( Property& dest ) const
284 {
285 // delegate to the 'opposite' method ;
286 return dest.assign( *this ) ;
287 }
288 // ============================================================================
290 // ============================================================================
291 template <class TYPE>
292 inline std::string
293 PropertyWithValue<TYPE>::toString () const
294 {
295 useReadHandler();
296 return Gaudi::Utils::toString( *m_value ) ;
297 }
298 // ============================================================================
300 // ============================================================================
301 template <class TYPE>
302 inline void
303 PropertyWithValue<TYPE>::toStream (std::ostream& out) const
304 {
305 useReadHandler();
306 Gaudi::Utils::toStream( *m_value, out ) ;
307 }
308 // ============================================================================
310 // ============================================================================
311 template <class TYPE>
312 inline StatusCode
313 PropertyWithValue<TYPE>::fromString ( const std::string& source )
314 {
315 TYPE tmp ;
316 StatusCode sc = Gaudi::Parsers::parse ( tmp , source ) ;
317 if ( sc.isFailure() ) { return sc ; }
318 return setValue ( tmp ) ? StatusCode::SUCCESS : StatusCode::FAILURE ;
319 }
320 // ============================================================================
322 // ============================================================================
323 template <>
324 inline std::string
325 PropertyWithValue<std::string>::toString () const
326 {
327 useReadHandler();
328 return this->value() ;
329 }
330 // ============================================================================
331 template <>
332 inline bool PropertyWithValue<std::string>::assign ( const Property& source )
333 { return this->fromString( source.toString() ).isSuccess() ; }
334 // ============================================================================
335
336 // ============================================================================
338 // ============================================================================
339 template <class TYPE>
340 inline const TYPE&
341 PropertyWithValue<TYPE>::value() const
342 { useReadHandler() ; return *m_value ; }
343 // ============================================================================
344 // assignment operator
345 // ============================================================================
346 template <class TYPE>
347 PropertyWithValue<TYPE>& PropertyWithValue<TYPE>::operator=
348 ( const PropertyWithValue& right )
349 {
350 // assign the base class
351 Property::operator=( right ) ;
352 // assign the value
353 PropertyWithValue<TYPE>::operator=( right.value() ) ;
354 return *this ;
355 }
356 // ============================================================================
357 // templated assignment operator
358 // ============================================================================
359 template <class TYPE>
360 template <class OTHER>
361 PropertyWithValue<TYPE>& PropertyWithValue<TYPE>::operator=
362 ( const PropertyWithValue<OTHER>& right )
363 {
364 // assign the base class
365 Property::operator=( right ) ;
366 // assign the value
367 PropertyWithValue<TYPE>::operator=( right.value() ) ;
368 return *this ;
369 }
370 // ============================================================================
371
372 // ============================================================================
380 // ============================================================================
381 template<class TYPE,class VERIFIER>
382 class PropertyWithVerifier
383 : public PropertyWithValue<TYPE>
384 {
385 protected:
386 // ==========================================================================
388 PropertyWithVerifier
389 ( std::string name ,
390 typename Gaudi::Utils::PropertyTypeTraits<TYPE>::PVal value ,
391 const bool owner ,
392 const VERIFIER& verifier )
393 : PropertyWithValue<TYPE> ( std::move(name) , value , owner )
394 , m_verifier ( verifier )
395 {}
397 ~PropertyWithVerifier() override = default;
398 // ==========================================================================
399 public:
400 // ==========================================================================
401 inline VERIFIER& verifier() { return m_verifier ; }
402 inline const VERIFIER& verifier() const { return m_verifier ; }
404 bool set( const TYPE& value ) ;
406 bool setValue( const TYPE& value ) override { return set( value ) ; }
408 template <class OTHER,class OTHERVERIFIER>
409 PropertyWithVerifier& operator=
410 ( const PropertyWithVerifier<OTHER,OTHERVERIFIER>& right ) ;
412 template <class OTHER>
413 PropertyWithVerifier& operator=( const PropertyWithValue<OTHER>& right ) ;
415 PropertyWithVerifier& operator=( const TYPE& right ) ;
416 // ==========================================================================
417 private:
418 // ==========================================================================
420 PropertyWithVerifier();
421 PropertyWithVerifier( const PropertyWithVerifier& right );
422 // ==========================================================================
423 private:
424 // ==========================================================================
426 VERIFIER m_verifier ; // the verifier itself
427 // ==========================================================================
428 } ;
429 // ============================================================================
431 // ============================================================================
432 template <class TYPE,class VERIFIER>
433 inline bool
434 PropertyWithVerifier<TYPE,VERIFIER>::set( const TYPE& value )
435 {
437 if ( !m_verifier.isValid( &value ) ) { return false ; }
439 this->i_set( value ) ;
441 return this->useUpdateHandler() ;
442 }
443 // ============================================================================
445 // ============================================================================
446 template <class TYPE,class VERIFIER>
447 inline PropertyWithVerifier<TYPE,VERIFIER>&
448 PropertyWithVerifier<TYPE,VERIFIER>::operator=( const TYPE& right )
449 {
450 PropertyWithValue<TYPE>::operator=( right ) ;
451 return *this ;
452 }
453 // ============================================================================
455 // ============================================================================
456 template <class TYPE,class VERIFIER>
457 template <class OTHER>
458 inline PropertyWithVerifier<TYPE,VERIFIER>&
459 PropertyWithVerifier<TYPE,VERIFIER>::operator=( const PropertyWithValue<OTHER>& right )
460 {
461 PropertyWithValue<TYPE>::operator=(right) ;
462 return *this ;
463 }
464 // ============================================================================
466 // ============================================================================
467 template <class TYPE,class VERIFIER>
468 template <class OTHER,class OTHERVERIFIER>
469 inline PropertyWithVerifier<TYPE,VERIFIER>&
470 PropertyWithVerifier<TYPE,VERIFIER>::operator=
471 ( const PropertyWithVerifier<OTHER,OTHERVERIFIER>& right )
472 {
473 PropertyWithValue<TYPE>::operator=(right) ;
474 return *this ;
475 }
476 // ============================================================================
477
478 // ============================================================================
488 // ============================================================================
489 template <class TYPE,class VERIFIER = BoundedVerifier<TYPE> >
490 class SimpleProperty
491 : public PropertyWithVerifier<TYPE,VERIFIER>
492 {
493 protected:
494 // ==========================================================================
495 typedef Gaudi::Utils::PropertyTypeTraits<TYPE> Traits ;
496 // ==========================================================================
497 public:
498 // ==========================================================================
500 SimpleProperty
501 ( VERIFIER verifier = VERIFIER() ) ;
503 SimpleProperty
504 ( const TYPE& value ,
505 VERIFIER verifier = VERIFIER() ) ;
507 SimpleProperty
508 ( std::string name ,
509 const TYPE& value ,
510 VERIFIER verifier = VERIFIER() ) ;
512 template <class OTHER>
513 SimpleProperty ( const PropertyWithValue<OTHER>& right ) ;
515 SimpleProperty ( const SimpleProperty& right ) ;
517 ~SimpleProperty() override = default;
519 SimpleProperty* clone() const override;
521 SimpleProperty& operator=( const TYPE& value ) ;
523 template <class OTHER>
524 SimpleProperty& operator=( const PropertyWithValue<OTHER>& right ) ;
525 // ==========================================================================
526 };
527 // ============================================================================
529 // ============================================================================
530 template <class TYPE,class VERIFIER>
531 SimpleProperty<TYPE,VERIFIER>::SimpleProperty
532 ( VERIFIER verifier )
533 : PropertyWithVerifier<TYPE,VERIFIER>
534 ( "" , Traits::new_() , true , verifier )
535 {}
536 // ============================================================================
538 // ============================================================================
539 template <class TYPE,class VERIFIER>
540 SimpleProperty<TYPE,VERIFIER>::SimpleProperty
541 ( const TYPE& value ,
542 VERIFIER verifier )
543 : PropertyWithVerifier<TYPE,VERIFIER>
544 ( "" , Traits::new_(value) , true , verifier )
545 {}
546 // ============================================================================
548 // ============================================================================
549 template <class TYPE,class VERIFIER>
550 SimpleProperty<TYPE,VERIFIER>::SimpleProperty
551 ( std::string name ,
552 const TYPE& value ,
553 VERIFIER verifier )
554 : PropertyWithVerifier<TYPE,VERIFIER>
555 ( std::move(name) , Traits::new_(value) , true , verifier )
556 {}
557 // ============================================================================
559 // ============================================================================
560 template <class TYPE,class VERIFIER>
561 template <class OTHER>
562 SimpleProperty<TYPE,VERIFIER>::SimpleProperty
563 ( const PropertyWithValue<OTHER>& right )
564 : PropertyWithVerifier<TYPE,VERIFIER>
565 ( right.name() , Traits::new_( right.value() ) , true , VERIFIER() )
566 {}
567 // ============================================================================
569 // ============================================================================
570 template <class TYPE,class VERIFIER>
571 SimpleProperty<TYPE,VERIFIER>::SimpleProperty
572 ( const SimpleProperty& right )
573 : PropertyWithVerifier<TYPE,VERIFIER>
574 ( right.name() , Traits::new_( right.value() ) , true , right.verifier() )
575 {}
576 // ============================================================================
578 // ============================================================================
579 template <class TYPE,class VERIFIER>
580 inline
581 SimpleProperty<TYPE,VERIFIER>*
582 SimpleProperty<TYPE,VERIFIER>::clone() const
583 { return new SimpleProperty(*this) ; }
584 // ============================================================================
586 // ============================================================================
587 template <class TYPE,class VERIFIER>
588 inline
589 SimpleProperty<TYPE,VERIFIER>&
590 SimpleProperty<TYPE,VERIFIER>::operator=( const TYPE& value )
591 {
592 PropertyWithVerifier<TYPE,VERIFIER>::operator=( value );
593 return *this ;
594 }
595 // ============================================================================
597 // ============================================================================
598 template <class TYPE,class VERIFIER>
599 template <class OTHER>
600 inline
601 SimpleProperty<TYPE,VERIFIER>&
602 SimpleProperty<TYPE,VERIFIER>::operator=
603 ( const PropertyWithValue<OTHER>& right )
604 {
605 PropertyWithVerifier<TYPE,VERIFIER>::operator=( right );
606 return *this ;
607 }
608 // ============================================================================
609
610 // ============================================================================
619 // ============================================================================
620 template< class TYPE, class VERIFIER = NullVerifier<TYPE> >
621 class SimplePropertyRef :
622 public PropertyWithVerifier<TYPE,VERIFIER>
623 {
624 public:
626 SimplePropertyRef
627 ( std::string name ,
628 TYPE& value ,
629 VERIFIER verifier = VERIFIER() ) ;
631 SimplePropertyRef ( const SimplePropertyRef& right ) ;
633 ~SimplePropertyRef() override = default;
635 SimplePropertyRef* clone() const override;
637 SimplePropertyRef& operator=( const TYPE& value ) ;
639 template <class OTHER>
640 SimplePropertyRef& operator=( const PropertyWithValue<OTHER>& right ) ;
641 private:
642 // the default constructor is disabled
643 SimplePropertyRef() ;
644 };
645 // ============================================================================
647 // ============================================================================
648 template <class TYPE,class VERIFIER>
649 SimplePropertyRef<TYPE,VERIFIER>::SimplePropertyRef
650 ( std::string name ,
651 TYPE& value ,
652 VERIFIER verifier )
653 : PropertyWithVerifier<TYPE,VERIFIER> ( std::move(name) , &value , false , verifier )
654 {}
655 // ============================================================================
657 // ============================================================================
658 template <class TYPE,class VERIFIER>
659 SimplePropertyRef<TYPE,VERIFIER>::SimplePropertyRef
660 ( const SimplePropertyRef& right )
661 : PropertyWithVerifier<TYPE,VERIFIER>
662 ( right.name() , right.i_get() , false , right.verifier() )
663 {}
664 // ============================================================================
666 // ============================================================================
667 template <class TYPE,class VERIFIER>
668 inline
669 SimplePropertyRef<TYPE,VERIFIER>*
670 SimplePropertyRef<TYPE,VERIFIER>::clone() const
671 { return new SimplePropertyRef(*this) ; }
672 // ============================================================================
674 // ============================================================================
675 template <class TYPE,class VERIFIER>
676 inline
677 SimplePropertyRef<TYPE,VERIFIER>&
678 SimplePropertyRef<TYPE,VERIFIER>::operator=( const TYPE& value )
679 {
680 PropertyWithVerifier<TYPE,VERIFIER>::operator=( value ) ;
681 return *this ;
682 }
683 // ============================================================================
685 // ============================================================================
686 template <class TYPE,class VERIFIER>
687 template <class OTHER>
688 inline
689 SimplePropertyRef<TYPE,VERIFIER>&
690 SimplePropertyRef<TYPE,VERIFIER>::operator=
691 ( const PropertyWithValue<OTHER>& right )
692 {
693 PropertyWithVerifier<TYPE,VERIFIER>::operator=( right );
694 return *this ;
695 }
696 // ============================================================================
697
698
699
700
701 // Typedef Properties for built-in types
702 typedef SimpleProperty< bool > BooleanProperty;
703 typedef SimpleProperty< char > CharProperty;
704 typedef SimpleProperty< signed char > SignedCharProperty;
705 typedef SimpleProperty< unsigned char > UnsignedCharProperty;
706 typedef SimpleProperty< short > ShortProperty;
707 typedef SimpleProperty< unsigned short > UnsignedShortProperty;
708 typedef SimpleProperty< int > IntegerProperty;
709 typedef SimpleProperty< unsigned int > UnsignedIntegerProperty;
710 typedef SimpleProperty< long > LongProperty;
711 typedef SimpleProperty< unsigned long > UnsignedLongProperty;
712 typedef SimpleProperty< long long> LongLongProperty;
713 typedef SimpleProperty< unsigned long long> UnsignedLongLongProperty;
714 typedef SimpleProperty< float > FloatProperty;
715 typedef SimpleProperty< double > DoubleProperty;
716 typedef SimpleProperty< long double > LongDoubleProperty;
717
718 typedef SimpleProperty< std::string > StringProperty;
719
720
721 // Typedef PropertyRefs for built-in types
722 typedef SimplePropertyRef< bool > BooleanPropertyRef;
723 typedef SimplePropertyRef< char > CharPropertyRef;
724 typedef SimplePropertyRef< signed char > SignedCharPropertyRef;
725 typedef SimplePropertyRef< unsigned char > UnsignedCharPropertyRef;
726 typedef SimplePropertyRef< short > ShortPropertyRef;
727 typedef SimplePropertyRef< unsigned short > UnsignedShortPropertyRef;
728 typedef SimplePropertyRef< int > IntegerPropertyRef;
729 typedef SimplePropertyRef< unsigned int > UnsignedIntegerPropertyRef;
730 typedef SimplePropertyRef< long > LongPropertyRef;
731 typedef SimplePropertyRef< unsigned long > UnsignedLongPropertyRef;
732 typedef SimplePropertyRef< long long > LongLongPropertyRef;
733 typedef SimplePropertyRef< unsigned long long > UnsignedLongLongPropertyRef;
734 typedef SimplePropertyRef< float > FloatPropertyRef;
735 typedef SimplePropertyRef< double > DoublePropertyRef;
736 typedef SimplePropertyRef< long double > LongDoublePropertyRef;
737
738 typedef SimplePropertyRef< std::string > StringPropertyRef;
739
740
741 // Typedef "Arrays" of Properties for built-in types
742 typedef SimpleProperty< std::vector< bool > > BooleanArrayProperty;
743 typedef SimpleProperty< std::vector< char > > CharArrayProperty;
744 typedef SimpleProperty< std::vector< signed char > > SignedCharArrayProperty;
745 typedef SimpleProperty< std::vector< unsigned char > > UnsignedCharArrayProperty;
746 typedef SimpleProperty< std::vector< short > > ShortArrayProperty;
747 typedef SimpleProperty< std::vector< unsigned short > > UnsignedShortArrayProperty;
748 typedef SimpleProperty< std::vector< int > > IntegerArrayProperty;
749 typedef SimpleProperty< std::vector< unsigned int > > UnsignedIntegerArrayProperty;
750 typedef SimpleProperty< std::vector< long > > LongArrayProperty;
751 typedef SimpleProperty< std::vector< unsigned long > > UnsignedLongArrayProperty;
752 typedef SimpleProperty< std::vector< long long > > LongLongArrayProperty;
753 typedef SimpleProperty< std::vector< unsigned long long > > UnsignedLongLongArrayProperty;
754 typedef SimpleProperty< std::vector< float > > FloatArrayProperty;
755 typedef SimpleProperty< std::vector< double > > DoubleArrayProperty;
756 typedef SimpleProperty< std::vector< long double > > LongDoubleArrayProperty;
757
758 typedef SimpleProperty< std::vector< std::string > > StringArrayProperty;
759
760
761 // Typedef "Arrays" of PropertyRefs for built-in types
762 typedef SimplePropertyRef< std::vector< bool > > BooleanArrayPropertyRef;
763 typedef SimplePropertyRef< std::vector< char > > CharArrayPropertyRef;
764 typedef SimplePropertyRef< std::vector< signed char > > SignedCharArrayPropertyRef;
765 typedef SimplePropertyRef< std::vector< unsigned char > > UnsignedCharArrayPropertyRef;
766 typedef SimplePropertyRef< std::vector< short > > ShortArrayPropertyRef;
767 typedef SimplePropertyRef< std::vector< unsigned short > > UnsignedShortArrayPropertyRef;
768 typedef SimplePropertyRef< std::vector< int > > IntegerArrayPropertyRef;
769 typedef SimplePropertyRef< std::vector< unsigned int > > UnsignedIntegerArrayPropertyRef;
770 typedef SimplePropertyRef< std::vector< long > > LongArrayPropertyRef;
771 typedef SimplePropertyRef< std::vector< unsigned long > > UnsignedLongArrayPropertyRef;
772 typedef SimplePropertyRef< std::vector< long long > > LongLongArrayPropertyRef;
773 typedef SimplePropertyRef< std::vector< unsigned long long > > UnsignedLongLongArrayPropertyRef;
774 typedef SimplePropertyRef< std::vector< float > > FloatArrayPropertyRef;
775 typedef SimplePropertyRef< std::vector< double > > DoubleArrayPropertyRef;
776 typedef SimplePropertyRef< std::vector< long double > > LongDoubleArrayPropertyRef;
777
778 typedef SimplePropertyRef< std::vector< std::string > > StringArrayPropertyRef;
779
780 // pre-declaration is sufficient here
781 class GaudiHandleBase;
782
783 class GAUDI_API GaudiHandleProperty : public Property {
784 public:
785 GaudiHandleProperty( std::string name, GaudiHandleBase& ref );
786
787 GaudiHandleProperty& operator=( const GaudiHandleBase& value );
788
789 GaudiHandleProperty* clone() const override;
790
791 bool load( Property& destination ) const override;
792
793 bool assign( const Property& source ) override;
794
795 std::string toString() const override;
796
797 void toStream(std::ostream& out) const override;
798
799 StatusCode fromString(const std::string& s) override;
800
801 const GaudiHandleBase& value() const;
802
803 bool setValue( const GaudiHandleBase& value );
804
805 private:
808 GaudiHandleBase* m_pValue;
809 };
810
811 // implementation in header file only where the GaudiHandleBase class
812 // definition is not needed. The rest goes into the .cpp file.
813 // The goal is to decouple the header files, to avoid that the whole
814 // world depends on GaudiHandle.h
815 inline GaudiHandleProperty& GaudiHandleProperty::operator=( const GaudiHandleBase& value ) {
816 setValue( value );
817 return *this;
818 }
819
820 inline GaudiHandleProperty* GaudiHandleProperty::clone() const {
821 return new GaudiHandleProperty( *this );
822 }
823
824 inline bool GaudiHandleProperty::load( Property& destination ) const {
825 return destination.assign( *this );
826 }
827
828 inline bool GaudiHandleProperty::assign( const Property& source ) {
829 return fromString( source.toString() ).isSuccess();
830 }
831
832 inline const GaudiHandleBase& GaudiHandleProperty::value() const {
833 useReadHandler();
834 return *m_pValue;
835 }
836
837
838 // pre-declaration is sufficient here
839 class GaudiHandleArrayBase;
840
841 class GAUDI_API GaudiHandleArrayProperty : public Property {
842 public:
843
844 GaudiHandleArrayProperty( std::string name, GaudiHandleArrayBase& ref );
845
846 GaudiHandleArrayProperty& operator=( const GaudiHandleArrayBase& value );
847
848 GaudiHandleArrayProperty* clone() const override;
849
850 bool load( Property& destination ) const override;
851
852 bool assign( const Property& source ) override;
853
854 std::string toString() const override;
855
856 void toStream(std::ostream& out) const override;
857
858 StatusCode fromString(const std::string& s) override;
859
860 const GaudiHandleArrayBase& value() const;
861
862 bool setValue( const GaudiHandleArrayBase& value );
863
864 private:
867 GaudiHandleArrayBase* m_pValue;
868
869 };
870
871 // implementation in header file only where the GaudiHandleBase class
872 // definition is not needed. The rest goes into the .cpp file.
873 // The goal is to decouple the header files, to avoid that the whole
874 // world depends on GaudiHandle.h
875 inline GaudiHandleArrayProperty& GaudiHandleArrayProperty::operator=( const GaudiHandleArrayBase& value ) {
876 setValue( value );
877 return *this;
878 }
879
880 inline GaudiHandleArrayProperty* GaudiHandleArrayProperty::clone() const {
881 return new GaudiHandleArrayProperty( *this );
882 }
883
884 inline bool GaudiHandleArrayProperty::load( Property& destination ) const {
885 return destination.assign( *this );
886 }
887
888 inline bool GaudiHandleArrayProperty::assign( const Property& source ) {
889 return fromString( source.toString() ) != 0;
890 }
891
892 inline const GaudiHandleArrayBase& GaudiHandleArrayProperty::value() const {
893 useReadHandler();
894 return *m_pValue;
895 }
896
897
898 namespace Gaudi
899 {
900 namespace Utils
901 {
902 // ========================================================================
920 GAUDI_API bool hasProperty ( const IProperty* p , const std::string& name ) ;
921 // ========================================================================
939 GAUDI_API bool hasProperty ( const IInterface* p , const std::string& name ) ;
940 // ========================================================================
958 GAUDI_API Property* getProperty
959 ( const IProperty* p , const std::string& name ) ;
960 // ========================================================================
978 GAUDI_API Property* getProperty
979 ( const IInterface* p , const std::string& name ) ;
980 // ========================================================================
1003 GAUDI_API bool hasProperty
1004 ( const std::vector<const Property*>* p ,
1005 const std::string& name ) ;
1006 // ========================================================================
1029 GAUDI_API const Property* getProperty
1030 ( const std::vector<const Property*>* p ,
1031 const std::string& name ) ;
1032 // ========================================================================
1056 template <class TYPE>
1057 StatusCode setProperty
1058 ( IProperty* component ,
1059 const std::string& name ,
1060 const TYPE& value ,
1061 const std::string& doc ) ;
1062 // ========================================================================
1085 template <class TYPE>
1086 StatusCode setProperty
1087 ( IProperty* component ,
1088 const std::string& name ,
1089 const TYPE& value )
1090 { return setProperty ( component , name , value , std::string() ) ; }
1091 // ========================================================================
1105 GAUDI_API StatusCode setProperty
1106 ( IProperty* component ,
1107 const std::string& name ,
1108 const std::string& value ,
1109 const std::string& doc = "" ) ;
1110 // ========================================================================
1124 GAUDI_API StatusCode setProperty
1125 ( IProperty* component ,
1126 const std::string& name ,
1127 const char* value ,
1128 const std::string& doc = "" ) ;
1129 // ========================================================================
1143 template <unsigned N>
1144 StatusCode setProperty
1145 ( IProperty* component ,
1146 const std::string& name ,
1147 const char (&value)[N] ,
1148 const std::string& doc = "" )
1149 {
1150 return component ? setProperty ( component , name ,
1151 std::string ( value , value + N ), doc )
1152 : StatusCode::FAILURE;
1153 }
1154 // ========================================================================
1185 template <class TYPE>
1186 StatusCode setProperty
1187 ( IProperty* component ,
1188 const std::string& name ,
1189 const TYPE& value ,
1190 const std::string& doc )
1191 {
1192 return component && hasProperty(component,name) ?
1193 Gaudi::Utils::setProperty ( component , name ,
1194 Gaudi::Utils::toString ( value ) , doc ) :
1195 StatusCode::FAILURE;
1196 }
1197 // ========================================================================
1219 GAUDI_API StatusCode setProperty
1220 ( IProperty* component ,
1221 const std::string& name ,
1222 const Property* property ,
1223 const std::string& doc = "" ) ;
1224 // ========================================================================
1246 GAUDI_API StatusCode setProperty
1247 ( IProperty* component ,
1248 const std::string& name ,
1249 const Property& property ,
1250 const std::string& doc = "" ) ;
1251 // ========================================================================
1274 template <class TYPE>
1275 StatusCode setProperty
1276 ( IProperty* component ,
1277 const std::string& name ,
1278 const SimpleProperty<TYPE>& value ,
1279 const std::string& doc = "" )
1280 {
1281 return setProperty ( component , name , &value , doc ) ;
1282 }
1283 // ========================================================================
1304 template <class TYPE>
1305 StatusCode setProperty
1306 ( IInterface* component ,
1307 const std::string& name ,
1308 const TYPE& value ,
1309 const std::string& doc = "" )
1310 {
1311 if ( !component ) { return StatusCode::FAILURE ; }
1312 auto property = SmartIF<IProperty>{ component } ;
1313 return property ? setProperty ( property , name , value , doc )
1314 : StatusCode::FAILURE;
1315 }
1316 // ========================================================================
1329 GAUDI_API StatusCode setProperty
1330 ( IInterface* component ,
1331 const std::string& name ,
1332 const std::string& value ,
1333 const std::string& doc = "" ) ;
1334 // ========================================================================
1347 GAUDI_API StatusCode setProperty
1348 ( IInterface* component ,
1349 const std::string& name ,
1350 const char* value ,
1351 const std::string& doc = "" ) ;
1352 // ========================================================================
1366 template <unsigned N>
1367 StatusCode setProperty
1368 ( IInterface* component ,
1369 const std::string& name ,
1370 const char (&value)[N] ,
1371 const std::string& doc = "" )
1372 {
1373 if ( 0 == component ) { return StatusCode::FAILURE ; }
1374 return setProperty ( component , name ,
1375 std::string{ value , value + N }, doc ) ;
1376 }
1377 // ========================================================================
1399 GAUDI_API StatusCode setProperty
1400 ( IInterface* component ,
1401 const std::string& name ,
1402 const Property* property ,
1403 const std::string& doc = "" ) ;
1404 // ========================================================================
1426 GAUDI_API StatusCode setProperty
1427 ( IInterface* component ,
1428 const std::string& name ,
1429 const Property& property ,
1430 const std::string& doc = "" ) ;
1431 // ========================================================================
1454 template <class TYPE>
1455 StatusCode
1456 setProperty
1457 ( IInterface* component ,
1458 const std::string& name ,
1459 const SimpleProperty<TYPE>& value ,
1460 const std::string& doc = "" )
1461 {
1462 return setProperty ( component , name , &value , doc ) ;
1463 }
1464 // ========================================================================
1465 } // end of namespace Gaudi::Utils
1466 } // end of namespace Gaudi
1467
1468
1469 // ============================================================================
1470 // The END
1471 // ============================================================================
1472 #endif // GAUDIKERNEL_PROPERTY_H
1473 // ============================================================================
UnsignedIntegerPropertyRef
SimplePropertyRef< unsigned int > UnsignedIntegerPropertyRef
Definition: Property.h:729
FloatPropertyRef
SimplePropertyRef< float > FloatPropertyRef
Definition: Property.h:734
IntegerArrayProperty
SimpleProperty< std::vector< int > > IntegerArrayProperty
Definition: Property.h:748
GaudiHandleProperty::operator=
GaudiHandleProperty & operator=(const GaudiHandleBase &value)
Definition: Property.h:815
Gaudi::Utils::setProperty
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1187
GaudiHandleArrayProperty::value
const GaudiHandleArrayBase & value() const
Definition: Property.h:892
CharArrayProperty
SimpleProperty< std::vector< char > > CharArrayProperty
Definition: Property.h:743
LongLongPropertyRef
SimplePropertyRef< long long > LongLongPropertyRef
Definition: Property.h:732
Property::m_documentation
std::string m_documentation
Definition: Property.h:115
Gaudi::Utils::PropertyTypeTraits
helper structure to define the types for properties
Definition: PropertyTypeTraits.h:44
std::out_of_range
STL class.
SmartIF< IProperty >
Kernel.h
GaudiHandleProperty::load
bool load(Property &destination) const override
export the property value to the destination
Definition: Property.h:824
Property::useReadHandler
virtual void useReadHandler() const
use the call-back function at reading
Definition: Property.cpp:80
GaudiHandleArrayProperty::clone
GaudiHandleArrayProperty * clone() const override
clone: "virtual constructor"
Definition: Property.h:880
UnsignedShortPropertyRef
SimplePropertyRef< unsigned short > UnsignedShortPropertyRef
Definition: Property.h:727
PropertyWithValue::PropertyWithValue
PropertyWithValue(std::string name, PVal value, const bool owner)
the constructor with property name and value
Definition: Property.h:213
CharPropertyRef
SimplePropertyRef< char > CharPropertyRef
Definition: Property.h:723
PropertyWithValue::i_get
PVal i_get() const
get the value
Definition: Property.h:194
GaudiHandleArrayProperty::setValue
bool setValue(const GaudiHandleArrayBase &value)
Definition: Property.cpp:206
Property::assign
virtual bool assign(const Property &source)=0
import the property value form the source
Property::updateCallBack
const std::function< void(Property &)> & updateCallBack() const
get a reference to the updateCallBack
Definition: Property.h:67
PropertyWithValue::~PropertyWithValue
~PropertyWithValue() override
virtual destructor
Definition: Property.h:249
PropertyWithValue::operator=
PropertyWithValue & operator=(const TYPE &value)
assignment operator
Definition: Property.h:258
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
operator<<
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Property &prop)
The output operator for friendly printout.
Definition: Property.cpp:32
LongArrayProperty
SimpleProperty< std::vector< long > > LongArrayProperty
Definition: Property.h:750
UnsignedIntegerArrayPropertyRef
SimplePropertyRef< std::vector< unsigned int > > UnsignedIntegerArrayPropertyRef
Definition: Property.h:769
std::function< void(Property &)>
Property::toString
virtual std::string toString() const =0
value -> string
DoublePropertyRef
SimplePropertyRef< double > DoublePropertyRef
Definition: Property.h:735
SimpleProperty::operator=
SimpleProperty & operator=(const TYPE &value)
assignment form the value
Definition: Property.h:590
SimplePropertyRef
SimplePropertyRef templated class.
Definition: HistoProperty.h:14
Property::name
const std::string & name() const
property name
Definition: Property.h:45
PropertyWithValue::setValue
virtual bool setValue(const TYPE &value)=0
NB: abstract : to be implemented when verifier is available.
DoubleArrayPropertyRef
SimplePropertyRef< std::vector< double > > DoubleArrayPropertyRef
Definition: Property.h:775
PropertyWithVerifier::PropertyWithVerifier
PropertyWithVerifier()
the default & copy constructors are deleted
PropertyWithVerifier
Helper intermediate class which represent partly implemented property with value of concrete type and...
Definition: Property.h:382
BooleanArrayProperty
SimpleProperty< std::vector< bool > > BooleanArrayProperty
Definition: Property.h:742
GaudiHandleProperty::clone
GaudiHandleProperty * clone() const override
clone: "virtual constructor"
Definition: Property.h:820
GaudiHandleArrayProperty::assign
bool assign(const Property &source) override
import the property value form the source
Definition: Property.h:888
Parsers.h
The declaration of major parsing functions used e.g for (re)implementation of new extended properties...
CharArrayPropertyRef
SimplePropertyRef< std::vector< char > > CharArrayPropertyRef
Definition: Property.h:763
GaudiHandleProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.cpp:191
LongLongArrayPropertyRef
SimplePropertyRef< std::vector< long long > > LongLongArrayPropertyRef
Definition: Property.h:772
Gaudi::Utils::hasProperty
GAUDI_API bool hasProperty(const IProperty *p, const std::string &name)
simple function which check the existence of the property with the given name.
Definition: Property.cpp:159
UnsignedLongLongArrayPropertyRef
SimplePropertyRef< std::vector< unsigned long long > > UnsignedLongLongArrayPropertyRef
Definition: Property.h:773
Gaudi::Utils::toString
std::string toString(const TYPE &obj)
the generic implementation of the type conversion to the string
Definition: ToStream.h:371
Property::setDocumentation
void setDocumentation(std::string documentation)
set the documentation string
Definition: Property.h:94
SimplePropertyRef::~SimplePropertyRef
~SimplePropertyRef() override=default
virtual Destructor
UnsignedIntegerArrayProperty
SimpleProperty< std::vector< unsigned int > > UnsignedIntegerArrayProperty
Definition: Property.h:749
SimplePropertyRef::operator=
SimplePropertyRef & operator=(const TYPE &value)
assignment form the value
Definition: Property.h:678
UnsignedLongArrayPropertyRef
SimplePropertyRef< std::vector< unsigned long > > UnsignedLongArrayPropertyRef
Definition: Property.h:771
GaudiHandleProperty
Definition: Property.h:783
FloatArrayPropertyRef
SimplePropertyRef< std::vector< float > > FloatArrayPropertyRef
Definition: Property.h:774
PropertyWithVerifier::setValue
bool setValue(const TYPE &value) override
implementation of PropertyWithValue::setValue
Definition: Property.h:406
Gaudi::Parsers::parse
StatusCode parse(GaudiUtils::HashMap< K, V > &result, const std::string &input)
Basic parser for the types of HashMap used in DODBasicMapper.
Definition: DODBasicMapper.cpp:11
Property::readCallBack
const std::function< void(Property &)> & readCallBack() const
get a reference to the readCallBack
Definition: Property.h:65
Property::declareUpdateHandler
Property & declareUpdateHandler(void(HT::*MF)(Property &), HT *instance)
Definition: Property.h:79
PropertyWithVerifier::set
bool set(const TYPE &value)
update the value of the property/check the verifier
Definition: Property.h:434
Property::load
virtual bool load(Property &dest) const =0
export the property value to the destination
ShortArrayPropertyRef
SimplePropertyRef< std::vector< short > > ShortArrayPropertyRef
Definition: Property.h:766
LongDoubleArrayPropertyRef
SimplePropertyRef< std::vector< long double > > LongDoubleArrayPropertyRef
Definition: Property.h:776
Gaudi::Utils::getProperty
GAUDI_API Property * getProperty(const IProperty *p, const std::string &name)
simple function which gets the property with given name from the component
Definition: Property.cpp:278
PropertyWithVerifier::operator=
PropertyWithVerifier & operator=(const PropertyWithVerifier< OTHER, OTHERVERIFIER > &right)
templated assignment
BooleanProperty
SimpleProperty< bool > BooleanProperty
Definition: Property.h:702
merge_files.sc
int sc
Definition: merge_files.py:167
Property::documentation
const std::string & documentation() const
property documentation
Definition: Property.h:47
PropertyWithValue::Traits
Gaudi::Utils::PropertyTypeTraits< TYPE > Traits
the type-traits for properties
Definition: Property.h:139
SignedCharArrayProperty
SimpleProperty< std::vector< signed char > > SignedCharArrayProperty
Definition: Property.h:744
GaudiHandleProperty::assign
bool assign(const Property &source) override
import the property value form the source
Definition: Property.h:828
BooleanPropertyRef
SimplePropertyRef< bool > BooleanPropertyRef
Definition: Property.h:722
SimplePropertyRef::SimplePropertyRef
SimplePropertyRef()
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
CharProperty
SimpleProperty< char > CharProperty
Definition: Property.h:703
StringProperty
SimpleProperty< std::string > StringProperty
Definition: Property.h:718
FloatArrayProperty
SimpleProperty< std::vector< float > > FloatArrayProperty
Definition: Property.h:754
std::type_info
PropertyVerifier.h
std::string
STL class.
compareRootHistos.ref
string ref
Definition: compareRootHistos.py:14
UnsignedCharArrayProperty
SimpleProperty< std::vector< unsigned char > > UnsignedCharArrayProperty
Definition: Property.h:745
SimpleProperty
SimpleProperty concrete class which implements the full Property interface.
Definition: HistoProperty.h:13
PropertyWithValue::m_value
PVal m_value
the actual property value
Definition: Property.h:201
LongDoubleProperty
SimpleProperty< long double > LongDoubleProperty
Definition: Property.h:716
Property::type
std::string type() const
property type
Definition: Property.h:51
SignedCharArrayPropertyRef
SimplePropertyRef< std::vector< signed char > > SignedCharArrayPropertyRef
Definition: Property.h:764
UnsignedLongProperty
SimpleProperty< unsigned long > UnsignedLongProperty
Definition: Property.h:711
IOTest.N
int N
Definition: IOTest.py:90
GaudiHandleProperty::m_pValue
GaudiHandleBase * m_pValue
Pointer to the real property.
Definition: Property.h:808
Gaudi::Utils::toStream
std::ostream & toStream(ITERATOR first, ITERATOR last, std::ostream &s, const std::string &open, const std::string &close, const std::string &delim)
the helper function to print the sequence
Definition: ToStream.h:319
LongPropertyRef
SimplePropertyRef< long > LongPropertyRef
Definition: Property.h:730
GaudiHandleProperty::GaudiHandleProperty
GaudiHandleProperty(std::string name, GaudiHandleBase &ref)
Definition: Property.cpp:170
gaudirun.type
string type
Definition: gaudirun.py:151
UnsignedShortArrayPropertyRef
SimplePropertyRef< std::vector< unsigned short > > UnsignedShortArrayPropertyRef
Definition: Property.h:767
LongLongProperty
SimpleProperty< long long > LongLongProperty
Definition: Property.h:712
PropertyWithValue
Helper intermediate class which represent partly implemented property with value of concrete type...
Definition: Property.h:134
UnsignedLongLongArrayProperty
SimpleProperty< std::vector< unsigned long long > > UnsignedLongLongArrayProperty
Definition: Property.h:753
StatusCode::FAILURE
Definition: StatusCode.h:29
UnsignedLongPropertyRef
SimplePropertyRef< unsigned long > UnsignedLongPropertyRef
Definition: Property.h:731
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
PropertyWithValue::toString
std::string toString() const override
value -> string
Definition: Property.h:293
UnsignedCharArrayPropertyRef
SimplePropertyRef< std::vector< unsigned char > > UnsignedCharArrayPropertyRef
Definition: Property.h:765
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
SmartIF.h
StringArrayProperty
SimpleProperty< std::vector< std::string > > StringArrayProperty
Definition: Property.h:758
ShortArrayProperty
SimpleProperty< std::vector< short > > ShortArrayProperty
Definition: Property.h:746
GaudiHandleArrayProperty::GaudiHandleArrayProperty
GaudiHandleArrayProperty(std::string name, GaudiHandleArrayBase &ref)
Definition: Property.cpp:200
gaudirun.dest
string dest
Definition: gaudirun.py:162
PropertyWithValue::i_set
void i_set(const TYPE &value)
set the value
Definition: Property.h:190
UnsignedShortProperty
SimpleProperty< unsigned short > UnsignedShortProperty
Definition: Property.h:707
PropertyWithVerifier::verifier
const VERIFIER & verifier() const
Definition: Property.h:402
GaudiPython.Bindings.GaudiHandleArrayProperty
GaudiHandleArrayProperty
Definition: Bindings.py:49
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
UnsignedCharProperty
SimpleProperty< unsigned char > UnsignedCharProperty
Definition: Property.h:705
PropertyWithVerifier::verifier
VERIFIER & verifier()
Definition: Property.h:401
SimpleProperty::~SimpleProperty
~SimpleProperty() override=default
virtual Destructor
LongProperty
SimpleProperty< long > LongProperty
Definition: Property.h:710
IntegerArrayPropertyRef
SimplePropertyRef< std::vector< int > > IntegerArrayPropertyRef
Definition: Property.h:768
Property::declareReadHandler
Property & declareReadHandler(void(HT::*MF)(Property &), HT *instance)
Definition: Property.h:75
SimpleProperty::Traits
Gaudi::Utils::PropertyTypeTraits< TYPE > Traits
Definition: Property.h:495
IntegerProperty
SimpleProperty< int > IntegerProperty
Definition: Property.h:708
FloatProperty
SimpleProperty< float > FloatProperty
Definition: Property.h:714
std::move
T move(T...args)
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
SimpleProperty::clone
SimpleProperty * clone() const override
implementation of Property::clone
Definition: Property.h:582
Property::m_name
std::string m_name
Definition: Property.h:113
Property::m_readCallBack
std::function< void(Property &)> m_readCallBack
Definition: Property.h:120
GaudiHandleArrayProperty::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.cpp:223
Property::operator=
Property & operator=(const Property &)=default
assignment operator
LongArrayPropertyRef
SimplePropertyRef< std::vector< long > > LongArrayPropertyRef
Definition: Property.h:770
SimpleProperty::SimpleProperty
SimpleProperty(VERIFIER verifier=VERIFIER())
"Almost default" constructor from verifier
Definition: Property.h:532
GaudiHandleArrayBase
Base class of array's of various gaudihandles.
Definition: GaudiHandle.h:320
Property
Property base class allowing Property* collections to be "homogeneous".
Definition: Property.h:38
PropertyWithValue::assign
bool assign(const Property &source) override
get the value from another property
Definition: Property.h:269
std::vector
STL class.
StringArrayPropertyRef
SimplePropertyRef< std::vector< std::string > > StringArrayPropertyRef
Definition: Property.h:778
PropertyWithValue::fromString
StatusCode fromString(const std::string &s) override
string -> value
Definition: Property.h:313
UnsignedLongLongPropertyRef
SimplePropertyRef< unsigned long long > UnsignedLongLongPropertyRef
Definition: Property.h:733
PropertyWithValue::m_own
bool m_own
owner of the storage
Definition: Property.h:203
IntegerPropertyRef
SimplePropertyRef< int > IntegerPropertyRef
Definition: Property.h:728
PropertyWithVerifier::m_verifier
VERIFIER m_verifier
the verifier itself
Definition: Property.h:426
LongLongArrayProperty
SimpleProperty< std::vector< long long > > LongLongArrayProperty
Definition: Property.h:752
Property::setName
void setName(std::string value)
set the new value for the property name
Definition: Property.h:92
SimplePropertyRef::clone
SimplePropertyRef * clone() const override
implementation of Property::clone
Definition: Property.h:670
GaudiHandleArrayProperty::operator=
GaudiHandleArrayProperty & operator=(const GaudiHandleArrayBase &value)
Definition: Property.h:875
PropertyWithValue::toStream
void toStream(std::ostream &out) const override
value -> stream
Definition: Property.h:303
GaudiHandleArrayProperty::m_pValue
GaudiHandleArrayBase * m_pValue
Pointer to the real property.
Definition: Property.h:867
fun
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
Property::m_updateCallBack
std::function< void(Property &)> m_updateCallBack
Definition: Property.h:122
GaudiHandleProperty::value
const GaudiHandleBase & value() const
Definition: Property.h:832
DoubleArrayProperty
SimpleProperty< std::vector< double > > DoubleArrayProperty
Definition: Property.h:755
gaudirun.s
string s
Definition: gaudirun.py:245
GaudiPython.Bindings.GaudiHandleProperty
GaudiHandleProperty
Definition: Bindings.py:48
UnsignedLongLongProperty
SimpleProperty< unsigned long long > UnsignedLongLongProperty
Definition: Property.h:713
LongDoubleArrayProperty
SimpleProperty< std::vector< long double > > LongDoubleArrayProperty
Definition: Property.h:756
GaudiHandleArrayProperty::load
bool load(Property &destination) const override
export the property value to the destination
Definition: Property.h:884
Property::type_info
const std::type_info * type_info() const
property type-info
Definition: Property.h:49
UnsignedIntegerProperty
SimpleProperty< unsigned int > UnsignedIntegerProperty
Definition: Property.h:709
PropertyWithValue::load
bool load(Property &dest) const override
set value for another property
Definition: Property.h:283
DoubleProperty
SimpleProperty< double > DoubleProperty
Definition: Property.h:715
UnsignedCharPropertyRef
SimplePropertyRef< unsigned char > UnsignedCharPropertyRef
Definition: Property.h:725
UnsignedShortArrayProperty
SimpleProperty< std::vector< unsigned short > > UnsignedShortArrayProperty
Definition: Property.h:747
GaudiHandleBase
Base class to handles to be used in lieu of naked pointers to various Gaudi components.
Definition: GaudiHandle.h:93
UnsignedLongArrayProperty
SimpleProperty< std::vector< unsigned long > > UnsignedLongArrayProperty
Definition: Property.h:751
ToStream.h
implementation of various functions for streaming.
Property::m_typeinfo
const std::type_info * m_typeinfo
Definition: Property.h:117
ShortProperty
SimpleProperty< short > ShortProperty
Definition: Property.h:706
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
ShortPropertyRef
SimplePropertyRef< short > ShortPropertyRef
Definition: Property.h:726
PropertyWithValue::PVal
Traits::PVal PVal
the actual storage type
Definition: Property.h:141
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
GaudiHandleArrayProperty
Definition: Property.h:841
Property::clone
virtual Property * clone() const =0
clone: "virtual constructor"
std::ostream
STL class.
PropertyWithVerifier::~PropertyWithVerifier
~PropertyWithVerifier() override=default
virtual destructor
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1
LongDoublePropertyRef
SimplePropertyRef< long double > LongDoublePropertyRef
Definition: Property.h:736
BooleanArrayPropertyRef
SimplePropertyRef< std::vector< bool > > BooleanArrayPropertyRef
Definition: Property.h:762
GaudiHandleProperty::setValue
bool setValue(const GaudiHandleBase &value)
Definition: Property.cpp:176
StringPropertyRef
SimplePropertyRef< std::string > StringPropertyRef
Definition: Property.h:738
Property::toStream
virtual void toStream(std::ostream &out) const =0
value -> stream
SignedCharPropertyRef
SimplePropertyRef< signed char > SignedCharPropertyRef
Definition: Property.h:724
SignedCharProperty
SimpleProperty< signed char > SignedCharProperty
Definition: Property.h:704
Property::fromString
virtual StatusCode fromString(const std::string &value)=0
string -> value