code format
This commit is contained in:
@@ -3,24 +3,24 @@
|
||||
* \~\brief
|
||||
* \~english Unique classes collection
|
||||
* \~russian Коллекция уникальных классов
|
||||
*/
|
||||
*/
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Peer - named I/O ethernet node, forming self-organized peering network
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
PIP - Platform Independent Primitives
|
||||
Peer - named I/O ethernet node, forming self-organized peering network
|
||||
Ivan Pelipenko peri4ko@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PICOLLECTION_H
|
||||
@@ -87,16 +87,16 @@
|
||||
#else
|
||||
|
||||
# define ADD_TO_COLLECTION(group, object) \
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, object, "", false);
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, object, "", false);
|
||||
|
||||
# define ADD_TO_COLLECTION_WITH_NAME(group, object, name) \
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, object, #name, false);
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, object, #name, false);
|
||||
|
||||
# define ADD_NEW_TO_COLLECTION(group, class) \
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, new class(), "", true);
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, new class(), "", true);
|
||||
|
||||
# define ADD_NEW_TO_COLLECTION_WITH_NAME(group, class, name) \
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, new class(), #name, true);
|
||||
static PICollection::CollectionAdder _PIP_ADD_COUNTER(_collection_adder_)(#group, new class(), #name, true);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -104,36 +104,35 @@
|
||||
//! \~\brief
|
||||
//! \~english Helper to collect and retrieve classes to groups.
|
||||
//! \~russian Помощник для создания и получения классов в группы.
|
||||
class PIP_EXPORT PICollection
|
||||
{
|
||||
class PIP_EXPORT PICollection {
|
||||
friend class __PICollectionInitializer;
|
||||
|
||||
public:
|
||||
PICollection() {;}
|
||||
|
||||
PICollection() { ; }
|
||||
|
||||
//! \~english Returns all existing groups by their names
|
||||
//! \~russian Возвращает имена всех групп
|
||||
static PIStringList groups();
|
||||
|
||||
|
||||
//! \~english Returns all elements of group "group"
|
||||
//! \~russian Возвращает все элементы группы "group"
|
||||
static PIVector<const PIObject * > groupElements(const PIString & group);
|
||||
|
||||
static PIVector<const PIObject *> groupElements(const PIString & group);
|
||||
|
||||
static bool addToGroup(const PIString & group, const PIObject * element);
|
||||
|
||||
class PIP_EXPORT CollectionAdder {
|
||||
public:
|
||||
CollectionAdder(const PIString & group, const PIObject * element, const PIString & name = PIString(), bool own = false);
|
||||
};
|
||||
|
||||
|
||||
protected:
|
||||
struct PIP_EXPORT Group {
|
||||
Group(const PIString & name_ = PIString()) {name = name_;}
|
||||
Group(const PIString & name_ = PIString()) { name = name_; }
|
||||
PIString name;
|
||||
PIVector<const PIObject * > elements;
|
||||
PIVector<const PIObject *> elements;
|
||||
};
|
||||
|
||||
|
||||
static PIVector<Group> & _groups();
|
||||
|
||||
};
|
||||
|
||||
#endif // PICOLLECTION_H
|
||||
|
||||
Reference in New Issue
Block a user