mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-10 07:09:46 +08:00
Comment changes
This commit is contained in:
parent
01f25e42f7
commit
a12d64c24e
16
observer.h
16
observer.h
@ -42,20 +42,20 @@ SOFTWARE.
|
|||||||
/// remain 'abstract' and will not compile.
|
/// remain 'abstract' and will not compile.
|
||||||
/// This ensures that no overload can be forgotten.<br>
|
/// This ensures that no overload can be forgotten.<br>
|
||||||
///
|
///
|
||||||
/// \li <b>Subject</b><br>
|
/// \li <b>observable</b><br>
|
||||||
/// The class derived from this will be observed by the above class.
|
/// The class derived from this will be observed by the above class.
|
||||||
/// It keeps a list of registered observers and will notify all
|
/// It keeps a list of registered observers and will notify all
|
||||||
/// of them with the notification when instructed.
|
/// of them with the notifications.
|
||||||
///\ingroup patterns
|
///\ingroup patterns
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "vector.h"
|
#include "vector.h"
|
||||||
#include "exception.h"
|
#include "exception.h"
|
||||||
|
#include "error_handler.h"
|
||||||
|
|
||||||
namespace etl
|
namespace etl
|
||||||
{
|
{
|
||||||
#ifdef ETL_THROW_EXCEPTIONS
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
///\ingroup observer
|
///\ingroup observer
|
||||||
/// The base class for observer exceptions.
|
/// The base class for observer exceptions.
|
||||||
@ -83,11 +83,10 @@ namespace etl
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
//*********************************************************************
|
//*********************************************************************
|
||||||
/// The object that is being observed.
|
/// The object that is being observed.
|
||||||
///\tparam TObserver The observer type.
|
///\tparam TObserver The observer type.
|
||||||
///\tparam MAX_OBSERVERS The maximum number of observers that can be accomodated.
|
///\tparam MAX_OBSERVERS The maximum number of observers that can be accomodated.
|
||||||
///\ingroup observer
|
///\ingroup observer
|
||||||
//*********************************************************************
|
//*********************************************************************
|
||||||
@ -103,7 +102,7 @@ namespace etl
|
|||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
/// Add an observer to the list.
|
/// Add an observer to the list.
|
||||||
/// If ETL_THROW_EXCEPTIONS is defined then an etl::observable_observer_list_full
|
/// If ETL_THROW_EXCEPTIONS is defined then an etl::observable_observer_list_full
|
||||||
/// is thrown if the observer list is already full.
|
/// is emitted if the observer list is already full.
|
||||||
///\param observer A reference to the observer.
|
///\param observer A reference to the observer.
|
||||||
//*****************************************************************
|
//*****************************************************************
|
||||||
void add_observer(TObserver& observer)
|
void add_observer(TObserver& observer)
|
||||||
@ -127,6 +126,11 @@ namespace etl
|
|||||||
{
|
{
|
||||||
throw observer_list_full();
|
throw observer_list_full();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
else
|
||||||
|
{
|
||||||
|
error_handler::error(observer_list_full());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user