<author>laurent.guigues@creatis.insa-lyon.fr</author>
<description>Adds its inputs</description>
+ <category>math</category>
<parentblackbox>bbtk::UserBlackBox</parentblackbox>
<package>std</package>
namespace bbstd
{
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,ConcatStrings)
BBTK_USER_BLACK_BOX_IMPLEMENTATION(ConcatStrings,bbtk::UserBlackBox);
namespace bbstd
{
-
class ConcatStrings
:
public bbtk::UserBlackBox
protected:
virtual void bbUserConstructor();
-
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ConcatStrings,bbtk::UserBlackBox);
BBTK_NAME("ConcatStrings");
- BBTK_AUTHOR("jpr@creatis.insa-lyon.fr");
+ BBTK_AUTHOR("jean-pierre.roux@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("misc");
BBTK_DESCRIPTION("String concatenation");
BBTK_INPUT(ConcatStrings,In1, "String 1", std::string);
BBTK_INPUT(ConcatStrings,In2, "String 2", std::string);
#include "bbtkConfigurationFile.h"
namespace bbstd
{
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,Configuration)
BBTK_USER_BLACK_BOX_IMPLEMENTATION(Configuration,bbtk::UserBlackBox);
}
-
void Configuration::DoProcess()
{
bbSetOutputDataPath( bbtk::ConfigurationFile::GetInstance().Get_data_path() );
}
}
// EO namespace bbstd
-
-
namespace bbstd
{
-
class Configuration
:
public bbtk::UserBlackBox
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Configuration,bbtk::UserBlackBox);
BBTK_NAME("Configuration");
BBTK_AUTHOR("jpr@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("misc");
BBTK_DESCRIPTION("Gets configuration informations");
BBTK_OUTPUT(Configuration,DataPath,"Sample Data Path",std::string);
BBTK_OUTPUT(Configuration,FileSeparator,"/ or \\",std::string);
BBTK_OUTPUT(Configuration,SystemType,"0=Linux 1=Windows",int);
BBTK_END_DESCRIBE_BLACK_BOX(Configuration);
-
}
// EO namespace bbstd
#endif // __bbstdConfiguration_h_INCLUDED__
-
-
namespace bbstd
{
-
//==================================================================
- class /*BBTK_EXPORT*/ MagicBox
+ class MagicBox
:
public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(MagicBox,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,bbtk::Data);
- BBTK_DECLARE_OUTPUT(Out,bbtk::Data);
+ BBTK_DECLARE_INPUT(In,bbtk::Data);
+ BBTK_DECLARE_OUTPUT(Out,bbtk::Data);
BBTK_PROCESS(DoProcess);
void DoProcess() { bbSetOutputOut( bbGetInputIn() ); }
//===========================================================================
-
BBTK_BEGIN_DESCRIBE_BLACK_BOX(MagicBox,bbtk::UserBlackBox);
BBTK_NAME("MagicBox");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("adaptor");
BBTK_DESCRIPTION("MagicBox");
- AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor
+ AddInputDescriptor(new bbtk::UserBlackBoxInputDescriptor
("In","Input data",
new bbtk::UserBlackBoxTGetFunctor<MagicBox,bbtk::Data,bbtk::Data>
(&MagicBox::bbGetInputIn),
new MagicBoxSetFunctor (&MagicBox::bbSetInputIn) ) );
- AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor
+ AddOutputDescriptor(new bbtk::UserBlackBoxOutputDescriptor
("Out","Output data",
new bbtk::UserBlackBoxTGetFunctor<MagicBox,bbtk::Data,bbtk::Data>
(&MagicBox::bbGetOutputOut),
public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(MakeFileName,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(Directory,std::string);
- BBTK_DECLARE_INPUT(File,std::string);
- BBTK_DECLARE_INPUT(Extent,std::string);
- BBTK_DECLARE_OUTPUT(Out,std::string);
+ BBTK_DECLARE_INPUT(Directory,std::string);
+ BBTK_DECLARE_INPUT(File,std::string);
+ BBTK_DECLARE_INPUT(Extent,std::string);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
BBTK_BEGIN_DESCRIBE_BLACK_BOX(MakeFileName,bbtk::UserBlackBox);
BBTK_NAME("MakeFileName");
BBTK_AUTHOR("jpr@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("misc");
BBTK_DESCRIPTION("Makes a kosher file name");
- BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string);
- BBTK_INPUT(MakeFileName,File,"File Name",std::string);
- BBTK_INPUT(MakeFileName,Extent,"Extention",std::string);
+ BBTK_INPUT(MakeFileName,Directory,"Directory Name",std::string);
+ BBTK_INPUT(MakeFileName,File,"File Name",std::string);
+ BBTK_INPUT(MakeFileName,Extent,"Extention",std::string);
- BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string);
+ BBTK_OUTPUT(MakeFileName,Out,"Full File Name",std::string);
BBTK_END_DESCRIBE_BLACK_BOX(MakeFileName);
}
namespace bbstd
{
-
template <class T>
- class /*BBTK_EXPORT*/ Relay
- :
+ class Relay
+ :
public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(Relay,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,T);
- BBTK_DECLARE_OUTPUT(Out,T);
+ BBTK_DECLARE_INPUT(In,T);
+ BBTK_DECLARE_OUTPUT(Out,T);
BBTK_PROCESS(Process);
protected:
void Process() { bbSetOutputOut ( bbGetInputIn() ); }
};
-
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(Relay);
BBTK_NAME(bbtk::HumanTypeName<T>()+"Relay");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("misc");
BBTK_DESCRIPTION("Relays a "+bbtk::TypeName<T>());
- BBTK_TEMPLATE_INPUT(Relay,In,"Input",T);
- BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T);
+ BBTK_TEMPLATE_INPUT(Relay,In,"Input",T);
+ BBTK_TEMPLATE_OUTPUT(Relay,Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(Relay);
-
}
// namespace bbstd
namespace bbstd
{
-
class /*BBTK_EXPORT*/ StringSelect
:
public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(StringSelect,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,int);
- BBTK_DECLARE_INPUT(In0,std::string);
- BBTK_DECLARE_INPUT(In1,std::string);
- BBTK_DECLARE_INPUT(In2,std::string);
- BBTK_DECLARE_INPUT(In3,std::string);
- BBTK_DECLARE_INPUT(In4,std::string);
- BBTK_DECLARE_INPUT(In5,std::string);
- BBTK_DECLARE_INPUT(In6,std::string);
- BBTK_DECLARE_INPUT(In7,std::string);
- BBTK_DECLARE_INPUT(In8,std::string);
- BBTK_DECLARE_INPUT(In9,std::string);
- BBTK_DECLARE_OUTPUT(Out,std::string);
+ BBTK_DECLARE_INPUT(In,int);
+ BBTK_DECLARE_INPUT(In0,std::string);
+ BBTK_DECLARE_INPUT(In1,std::string);
+ BBTK_DECLARE_INPUT(In2,std::string);
+ BBTK_DECLARE_INPUT(In3,std::string);
+ BBTK_DECLARE_INPUT(In4,std::string);
+ BBTK_DECLARE_INPUT(In5,std::string);
+ BBTK_DECLARE_INPUT(In6,std::string);
+ BBTK_DECLARE_INPUT(In7,std::string);
+ BBTK_DECLARE_INPUT(In8,std::string);
+ BBTK_DECLARE_INPUT(In9,std::string);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoProcess);
void DoProcess();
BBTK_BEGIN_DESCRIBE_BLACK_BOX(StringSelect,bbtk::UserBlackBox);
BBTK_NAME("StringSelect");
BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("misc");
BBTK_DESCRIPTION("String selection with 0-9 entries");
- BBTK_INPUT(StringSelect,In,"Index of the string to select",int);
- BBTK_INPUT(StringSelect,In0,"String of index 0",std::string);
- BBTK_INPUT(StringSelect,In1,"String of index 1",std::string);
- BBTK_INPUT(StringSelect,In2,"String of index 2",std::string);
- BBTK_INPUT(StringSelect,In3,"String of index 3",std::string);
- BBTK_INPUT(StringSelect,In4,"String of index 4",std::string);
- BBTK_INPUT(StringSelect,In5,"String of index 4",std::string);
- BBTK_INPUT(StringSelect,In6,"String of index 6",std::string);
- BBTK_INPUT(StringSelect,In7,"String of index 7",std::string);
- BBTK_INPUT(StringSelect,In8,"String of index 8",std::string);
- BBTK_INPUT(StringSelect,In9,"String of index 9",std::string);
- BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string);
+ BBTK_INPUT(StringSelect,In,"Index of the string to select",int);
+ BBTK_INPUT(StringSelect,In0,"String of index 0",std::string);
+ BBTK_INPUT(StringSelect,In1,"String of index 1",std::string);
+ BBTK_INPUT(StringSelect,In2,"String of index 2",std::string);
+ BBTK_INPUT(StringSelect,In3,"String of index 3",std::string);
+ BBTK_INPUT(StringSelect,In4,"String of index 4",std::string);
+ BBTK_INPUT(StringSelect,In5,"String of index 4",std::string);
+ BBTK_INPUT(StringSelect,In6,"String of index 6",std::string);
+ BBTK_INPUT(StringSelect,In7,"String of index 7",std::string);
+ BBTK_INPUT(StringSelect,In8,"String of index 8",std::string);
+ BBTK_INPUT(StringSelect,In9,"String of index 9",std::string);
+ BBTK_OUTPUT(StringSelect,Out,"Selected string",std::string);
BBTK_END_DESCRIBE_BLACK_BOX(StringSelect);
-
}
// EO namespace bbstd
#include "bbtkUserBlackBox.h"
-
namespace bbstd
-{
-
-
+{
//=================================================================
// UserBlackBox declaration
template <class T>
class StringTo : public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(StringTo,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,std::string);
- BBTK_DECLARE_OUTPUT(Out,T);
+ BBTK_DECLARE_INPUT(In,std::string);
+ BBTK_DECLARE_OUTPUT(Out,T);
BBTK_PROCESS(DoIt);
void DoIt();
};
+
//=================================================================
-
-
-
- //=================================================================
// UserBlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo);
BBTK_NAME("StringTo"+bbtk::HumanTypeName<T>());
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("adaptor");
BBTK_DEFAULT_ADAPTOR();
BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName<T>());
- BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string);
- BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T);
+ BBTK_TEMPLATE_INPUT(StringTo, In,"Input",std::string);
+ BBTK_TEMPLATE_OUTPUT(StringTo, Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringTo);
//=================================================================
} // namespace bbstd
#endif // __bbstdStringTo_h_INCLUDED__
-
-
-
-
namespace bbstd
{
-
//=================================================================
// UserBlackBox declaration
template <class T>
class StringToVector : public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(StringToVector,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,std::string);
- BBTK_DECLARE_OUTPUT(Out,std::vector<T>);
+ BBTK_DECLARE_INPUT(In,std::string);
+ BBTK_DECLARE_OUTPUT(Out,std::vector<T>);
BBTK_PROCESS(DoIt);
void DoIt();
T decode_item(const std::string&);
};
-//=================================================================
-
-
//=================================================================
+
// UserBlackBox description
-BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
-BBTK_NAME("StringTo"+bbtk::TypeName<std::vector<T> >());
-BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
-BBTK_DEFAULT_ADAPTOR();
-BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName<std::vector<T> >());
-BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string);
-typedef std::vector<T> Tvector;
-BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector);
-BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
-//=================================================================
-
-
+ BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
+ BBTK_NAME("StringTo"+bbtk::TypeName<std::vector<T> >());
+ BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("adaptor");
+ BBTK_DEFAULT_ADAPTOR();
+ BBTK_DESCRIPTION("Converts the content of the input string to a "+bbtk::TypeName<std::vector<T> >());
+ BBTK_TEMPLATE_INPUT(StringToVector, In,"Input",std::string);
+ typedef std::vector<T> Tvector;
+ BBTK_TEMPLATE_OUTPUT(StringToVector, Out,"Output",Tvector);
+ BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(StringToVector);
//=================================================================
+
template <class T>
void StringToVector<T>::DoIt()
{
} // namespace bbstd
#endif //__bbstdStringToVector_INCLUDED_h__
-
#include "bbtkUserBlackBox.h"
namespace bbstd
-{
-
+{
//=================================================================
// UserBlackBox declaration
template <class T>
class ToString : public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(ToString,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,T);
- BBTK_DECLARE_OUTPUT(Out,std::string);
+ BBTK_DECLARE_INPUT(In,T);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoIt);
void DoIt();
};
- //=================================================================
-
-
-
//=================================================================
+
// UserBlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(ToString);
BBTK_NAME(bbtk::TypeName<T>()+"ToString");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("adaptor");
BBTK_DEFAULT_ADAPTOR();
BBTK_DESCRIPTION("Converts a "+bbtk::TypeName<T>()+" into a string");
- BBTK_TEMPLATE_INPUT(ToString, In,"Input",T);
- BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string);
+ BBTK_TEMPLATE_INPUT(ToString, In,"Input",T);
+ BBTK_TEMPLATE_OUTPUT(ToString, Out,"Output",std::string);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(ToString);
//=================================================================
namespace bbstd
{
-
//=================================================================
// UserBlackBox declaration
template <class T>
class VectorToString : public bbtk::UserBlackBox
{
BBTK_USER_BLACK_BOX_INTERFACE(VectorToString,bbtk::UserBlackBox);
- BBTK_DECLARE_INPUT(In,std::vector<T>);
- BBTK_DECLARE_INPUT(Separator,std::string);
- BBTK_DECLARE_OUTPUT(Out,std::string);
+ BBTK_DECLARE_INPUT(In,std::vector<T>);
+ BBTK_DECLARE_INPUT(Separator,std::string);
+ BBTK_DECLARE_OUTPUT(Out,std::string);
BBTK_PROCESS(DoIt);
void DoIt();
virtual void bbUserConstructor();
};
+
//=================================================================
-
-
-
- //=================================================================
+
// UserBlackBox description
BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString);
BBTK_NAME(bbtk::TypeName<std::vector<T> >()+"ToString");
BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+ BBTK_CATEGORY("adaptor");
BBTK_DEFAULT_ADAPTOR();
BBTK_DESCRIPTION("Converts the content of the input vector ("+bbtk::TypeName<std::vector<T> >()+") to a string in which each item is separated by the value of the input 'Separator'");
- typedef std::vector<T> Tvector;
- BBTK_TEMPLATE_INPUT(VectorToString, In,"Input",Tvector);
- BBTK_TEMPLATE_INPUT(VectorToString, Separator,"Separator of item in the output string. Default is whitespace.",std::string);
- BBTK_TEMPLATE_OUTPUT(VectorToString, Out,"Output",std::string);
+ typedef std::vector<T> Tvector;
+ BBTK_TEMPLATE_INPUT(VectorToString, In,"Input",Tvector);
+ BBTK_TEMPLATE_INPUT(VectorToString, Separator,"Separator of item in the output string. Default is whitespace.",std::string);
+ BBTK_TEMPLATE_OUTPUT(VectorToString, Out,"Output",std::string);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(VectorToString);
- //=================================================================
-
-
//=================================================================
+
template <class T>
void VectorToString<T>::DoIt()
{
std::string out;
typename std::vector<T>::const_iterator i;
for (i=bbmInputIn.begin();i!=bbmInputIn.end();++i)
- {
- if (i!=bbmInputIn.begin()) out += bbGetInputSeparator();
- std::ostringstream s;
- s << *i;
- out += s.str();
- }
+ {
+ if (i!=bbmInputIn.begin())
+ out += bbGetInputSeparator();
+ std::ostringstream s;
+ s << *i;
+ out += s.str();
+ }
bbSetOutputOut(out);
}
- //=================================================================
//=================================================================
+
template <class T>
void VectorToString<T>::bbUserConstructor()
{