bbtk::WidgetBlackBoxDescriptor< T > Class Template Reference

#include <bbtkWidgetBlackBox.h>

Inheritance diagram for bbtk::WidgetBlackBoxDescriptor< T >:

Inheritance graph
[legend]
Collaboration diagram for bbtk::WidgetBlackBoxDescriptor< T >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef
WidgetBlackBoxDescriptor< T > 
Self
typedef boost::shared_ptr< SelfPointer
typedef boost::weak_ptr< SelfWeakPointer
enum  Kind {
  STANDARD = 0, ADAPTOR = 1, DEFAULT_ADAPTOR = 2, GUI = 3,
  DEFAULT_GUI = 4
}
 The kinds of black box. More...
typedef BlackBoxInputDescriptor InputDescriptor
 The type of descriptor of inputs.
typedef BlackBoxOutputDescriptor OutputDescriptor
 The type of descriptor of outputs.
typedef std::map< std::string,
InputDescriptor * > 
InputDescriptorMapType
 The type of dictionnary of inputs = map of input descriptors pointers.
typedef std::map< std::string,
OutputDescriptor * > 
OutputDescriptorMapType
 The type of dictionnary of outputs= map of output descriptors pointers.

Public Member Functions

std::string GetObjectName () const
virtual
bbtk::AtomicBlackBoxDescriptor::Pointer 
GetInstance () const
bbtk::BlackBox::Pointer NewBlackBox (const std::string &name)
 Releases a descriptor.
 WidgetBlackBoxDescriptor ()
const std::string & GetTypeName () const
 Returns the name of the **TYPE** of the black box.
std::string GetFullTypeName () const
 Returns the full name of the **TYPE** of the black box (+package name).
const std::string & GetDescription () const
 Returns the description of the BlackBox.
const std::string & GetAuthor () const
 Returns the author(s) of the BlackBox.
const std::string & GetCategory () const
 Returns the category(s) of the BlackBox.
PackagePointer GetPackage () const
 Returns the Package to which the box belongs (const pointer).
Kind GetKind () const
 Returns the kind of box.
virtual void GetHelp (bool full=true) const
 Prints help on the black box.
const InputDescriptorMapTypeGetInputDescriptorMap () const
 Returns a const ref on the map of input descriptors.
const OutputDescriptorMapTypeGetOutputDescriptorMap () const
 Returns a const ref on the map of output descriptors.
const InputDescriptorGetInputDescriptor (const std::string &name) const
 Returns a const pointer on the descriptor of the input of name <name>.
const OutputDescriptorGetOutputDescriptor (const std::string &name) const
 Returns a const pointer on the descriptor of the output of name <name>.
void SetTypeName (const std::string &name)
 Sets the name of the **TYPE** of BlackBox.
void AddToDescription (const std::string &, bool clear=false)
 Adds the string to the BlackBox description.
void AddToAuthor (const std::string &, bool clear=false)
 Adds the string to the BlackBox author list.
void AddToCategory (const std::string &, bool clear=false)
 Adds the string to the BlackBox category list.
void SetPackage (PackagePointer package)
 Sets the Package to which the box belongs.
void SetKind (Kind kind)
 Sets the kind of box.
virtual void InsertHtmlHelp (std::ofstream &s, int detail, int level, const std::string &output_dir="", bool relative_link=false)
virtual void Check (bool recursive=true) const
 Check.
virtual std::string GetObjectInfo () const
virtual size_t GetObjectSize () const
virtual size_t GetObjectInternalSize () const
virtual size_t GetObjectRecursiveSize () const
long GetUseCount ()

Static Public Member Functions

static Pointer New ()
static
bbtk::AtomicBlackBoxDescriptor::Pointer 
Instance ()
static void InsertInObjectList (Pointer)
static void RemoveFromObjectList (WeakPointer)
static void InsertInPackageList (Pointer)
static void ReleasePackages ()
static void PrintObjectListInfo (const std::string &name)
static void PrintObjectInfo (const Pointer &o)
static long GetObjectsCount ()

Protected Member Functions

void AddInputDescriptor (BlackBoxInputDescriptor *d)
 Adds an input descriptor.
void AddOutputDescriptor (BlackBoxOutputDescriptor *d)
 Adds an output descriptor.
void LockThis ()
void UnLockThis ()
template<class U >
boost::shared_ptr< U > GetThisPointer () const

Static Protected Member Functions

template<class U >
static boost::shared_ptr< U > MakePointer (U *s, bool lock=false)
template<class U , class D >
static boost::shared_ptr< U > MakePointer (U *s, const D &del, bool lock=false)

Protected Attributes

std::string mTypeName
 The name of the type of black box.
std::string mDescription
 The description of the black box.
std::string mAuthor
 The author of the black box.
std::string mCategory
 The category of the black box.
Kind mKind
 The kind of box (standard / adaptor).
PackagePointer mPackage
 The Package to which the box belongs.
InputDescriptorMapType mInput
 The inputs.
OutputDescriptorMapType mOutput
 The outputs.

Friends

struct Object::Deleter


Detailed Description

template<class T>
class bbtk::WidgetBlackBoxDescriptor< T >

Definition at line 200 of file bbtkWidgetBlackBox.h.


Member Typedef Documentation

The type of descriptor of inputs.

Definition at line 61 of file bbtkBlackBoxDescriptor.h.

typedef std::map<std::string, InputDescriptor*> bbtk::BlackBoxDescriptor::InputDescriptorMapType [inherited]

The type of dictionnary of inputs = map of input descriptors pointers.

Definition at line 68 of file bbtkBlackBoxDescriptor.h.

The type of descriptor of outputs.

Definition at line 66 of file bbtkBlackBoxDescriptor.h.

typedef std::map<std::string, OutputDescriptor*> bbtk::BlackBoxDescriptor::OutputDescriptorMapType [inherited]

The type of dictionnary of outputs= map of output descriptors pointers.

Definition at line 70 of file bbtkBlackBoxDescriptor.h.

template<class T >
typedef boost::shared_ptr<Self> bbtk::WidgetBlackBoxDescriptor< T >::Pointer

Reimplemented from bbtk::BlackBoxDescriptor.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

template<class T >
typedef WidgetBlackBoxDescriptor<T> bbtk::WidgetBlackBoxDescriptor< T >::Self

Reimplemented from bbtk::BlackBoxDescriptor.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

template<class T >
typedef boost::weak_ptr<Self> bbtk::WidgetBlackBoxDescriptor< T >::WeakPointer

Reimplemented from bbtk::BlackBoxDescriptor.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.


Member Enumeration Documentation

The kinds of black box.

Enumerator:
STANDARD 
ADAPTOR 
DEFAULT_ADAPTOR 
GUI 
DEFAULT_GUI 

Definition at line 72 of file bbtkBlackBoxDescriptor.h.

00073     {
00074       STANDARD=0,
00075       ADAPTOR=1,
00076       DEFAULT_ADAPTOR=2,
00077       GUI=3,
00078       DEFAULT_GUI=4
00079     }


Constructor & Destructor Documentation

template<class T >
bbtk::WidgetBlackBoxDescriptor< T >::WidgetBlackBoxDescriptor (  )  [inline]

Definition at line 200 of file bbtkWidgetBlackBox.h.

00208                                      : only used if the widget is not connected to a Layout box)",int);
00209   BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHeight,
00210              "Height of the window (*)",int);
00211   BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinDialog,
00212              "Set to 'true' to create a dialog window, i.e. which blocks the pipeline until it is closed (modal) (*)",bool);
00213   BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinHide,
00214              "Any signal received hides the window (*)",Void);
00215   BBTK_TEMPLATE_INPUT(WidgetBlackBox,WinClose,
00216              "Any signal received closes the window (*)",Void);
00217   typedef typename WidgetBlackBox<T>::WidgetPointer WidgetPointer;
00218   BBTK_TEMPLATE_OUTPUT(WidgetBlackBox,Widget,"Output widget",WidgetPointer);
00219   BBTK_END_DESCRIBE_BLACK_BOX(WidgetBlackBox);


Member Function Documentation

void bbtk::BlackBoxDescriptor::AddInputDescriptor ( BlackBoxInputDescriptor d  )  [inline, protected, inherited]

Adds an input descriptor.

Definition at line 163 of file bbtkBlackBoxDescriptor.h.

References bbtk::BlackBoxInputOutputDescriptor::GetName().

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and bbtk::ComplexBlackBoxDescriptor::DefineInput().

00164     { mInput[d->GetName()] = d; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddOutputDescriptor ( BlackBoxOutputDescriptor d  )  [inline, protected, inherited]

Adds an output descriptor.

Definition at line 166 of file bbtkBlackBoxDescriptor.h.

References bbtk::BlackBoxInputOutputDescriptor::GetName().

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and bbtk::ComplexBlackBoxDescriptor::DefineOutput().

00167     { mOutput[d->GetName()] = d; }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddToAuthor ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox author list.

Definition at line 162 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mAuthor.

00163   {
00164     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToAuthor(\""
00165                       <<s<<"\")"
00166                       <<std::endl);
00167     if (clear) mAuthor = s;
00168     else mAuthor += s;
00169   }

void bbtk::BlackBoxDescriptor::AddToCategory ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox category list.

Definition at line 174 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mCategory.

Referenced by bbtk::AtomicBlackBoxDescriptor::AtomicBlackBoxDescriptor(), and bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor().

00175   {
00176     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToCategory(\""
00177                       <<s<<"\")"
00178                       <<std::endl);  
00179     if (clear) mCategory = s;
00180     else mCategory += s;
00181     mCategory += ";";
00182   }  

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::AddToDescription ( const std::string &  s,
bool  clear = false 
) [inherited]

Adds the string to the BlackBox description.

Definition at line 151 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, and bbtk::BlackBoxDescriptor::mDescription.

00152   {
00153     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::AddToDescription(\""
00154                       <<s<<"\")"<<std::endl);
00155     if (clear) mDescription = s; 
00156     else mDescription += s;
00157    }

void bbtk::BlackBoxDescriptor::Check ( bool  recursive = true  )  const [virtual, inherited]

Check.

Reimplemented in bbtk::ComplexBlackBoxDescriptor.

Definition at line 143 of file bbtkBlackBoxDescriptor.cxx.

00144   {
00145     
00146   }

const std::string& bbtk::BlackBoxDescriptor::GetAuthor (  )  const [inline, inherited]

const std::string& bbtk::BlackBoxDescriptor::GetCategory (  )  const [inline, inherited]

const std::string& bbtk::BlackBoxDescriptor::GetDescription (  )  const [inline, inherited]

std::string bbtk::BlackBoxDescriptor::GetFullTypeName (  )  const [inherited]

Returns the full name of the **TYPE** of the black box (+package name).

Definition at line 304 of file bbtkBlackBoxDescriptor.cxx.

References bbtk::BlackBoxDescriptor::GetPackage(), and bbtk::BlackBoxDescriptor::mTypeName.

Referenced by bbtk::BlackBoxDescriptor::GetHelp(), bbtk::ComplexBlackBoxDescriptor::GetObjectName(), and bbtk::WxGUIBlackBoxList::OnBeginDrag().

00305   {
00306     if (GetPackage()!=0) return GetPackage()->GetName() + "::" + mTypeName;
00307     return "::" + mTypeName;
00308   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::GetHelp ( bool  full = true  )  const [virtual, inherited]

Prints help on the black box.

Reimplemented in bbtk::ComplexBlackBoxDescriptor.

Definition at line 222 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkMessage, bbtk::BlackBoxDescriptor::GetAuthor(), bbtk::BlackBoxDescriptor::GetCategory(), bbtk::BlackBoxDescriptor::GetDescription(), bbtk::BlackBoxDescriptor::GetFullTypeName(), bbtk::i, bbtk::BlackBoxDescriptor::mInput, and bbtk::BlackBoxDescriptor::mOutput.

00223   {
00224     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetHelp()"
00225                       <<std::endl);
00226     
00227     bbtkMessage("help",1,"Black Box <"<<GetFullTypeName()<<">"<<std::endl);
00228     bbtkMessage("help",1," "              <<GetDescription()<<std::endl);
00229     bbtkMessage("help",1," By : "         <<GetAuthor()     <<std::endl);
00230     bbtkMessage("help",1," Categories : " <<GetCategory()    <<std::endl);
00231     if (mInput.size()) 
00232       bbtkMessage("help",1," * Inputs : "<<std::endl);
00233     else 
00234       bbtkMessage("help",1," * No inputs"<<std::endl);
00235     InputDescriptorMapType::const_iterator i;
00236     unsigned int namelmax = 0;
00237     unsigned int typelmax = 0;
00238     unsigned int natlmax = 0;
00239     for ( i = mInput.begin();  i != mInput.end(); ++i ) 
00240     {
00241            if (i->second->GetName().size()>namelmax) 
00242              namelmax = i->second->GetName().size();
00243            if (i->second->GetHumanTypeName().size()>typelmax) 
00244              typelmax = i->second->GetHumanTypeName().size();
00245            if (i->second->GetNature().size()>natlmax) 
00246              natlmax = i->second->GetNature().size();
00247     }
00248     OutputDescriptorMapType::const_iterator o;
00249     for ( o = mOutput.begin();  o != mOutput.end(); ++o ) 
00250     {
00251            if (o->second->GetName().size()>namelmax) 
00252              namelmax = o->second->GetName().size();
00253            if (o->second->GetHumanTypeName().size()>typelmax) 
00254              typelmax = o->second->GetHumanTypeName().size();
00255            if (o->second->GetNature().size()>natlmax) 
00256              natlmax = o->second->GetNature().size();
00257     }
00258     //
00259     for ( i = mInput.begin();  i != mInput.end(); ++i ) 
00260     {
00261            std::string name(i->second->GetName());
00262            name += "'";
00263            name.append(1+namelmax-name.size(),' ');
00264            std::string type(i->second->GetHumanTypeName());
00265            type += ">";
00266            type.append(1+typelmax-type.size(),' ');
00267            std::string nature(i->second->GetNature());
00268            nature += "]";
00269            nature.append(1+natlmax-nature.size(),' ');
00270            bbtkMessage("help",1,
00271                        "    '"<<name
00272                        <<" <"<<type
00273                        <<" ["<<nature
00274                        <<" : "<<i->second->GetDescription()<<std::endl);
00275     }
00276     if (mOutput.size()) 
00277       bbtkMessage("help",1," * Outputs : "<<std::endl);
00278     else 
00279       bbtkMessage("help",1," * No outputs"<<std::endl);
00280     for ( o = mOutput.begin();  o != mOutput.end(); ++o ) 
00281     {
00282            std::string name(o->second->GetName());
00283            name += "'";
00284            name.append(1+namelmax-name.size(),' ');
00285            std::string type(o->second->GetHumanTypeName());
00286            type += ">";
00287            type.append(1+typelmax-type.size(),' ');
00288            std::string nature(o->second->GetNature());
00289            nature += "]";
00290            nature.append(1+natlmax-nature.size(),' ');
00291            bbtkMessage("help",1,
00292                     "    '"<<name
00293                        <<" <"<<type
00294                        <<" ["<<nature
00295                        <<" : "<<o->second->GetDescription()<<std::endl);
00296       }
00297    
00298   
00299   }

Here is the call graph for this function:

const BlackBoxDescriptor::InputDescriptor * bbtk::BlackBoxDescriptor::GetInputDescriptor ( const std::string &  name  )  const [inherited]

Returns a const pointer on the descriptor of the input of name <name>.

Definition at line 187 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, bbtk::i, and bbtk::BlackBoxDescriptor::mInput.

00188   {
00189     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetInputDescriptor('"
00190                       <<name<<"')"<<std::endl);
00191 
00192     InputDescriptorMapType::const_iterator i;
00193     i = mInput.find(name);
00194     if ( i == mInput.end() ) 
00195     {
00196             bbtkError("input '"<<name<<"' does not exist");
00197     }
00198 
00199     return i->second;
00200   }

const InputDescriptorMapType& bbtk::BlackBoxDescriptor::GetInputDescriptorMap (  )  const [inline, inherited]

Returns a const ref on the map of input descriptors.

Definition at line 114 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::ComplexBlackBoxDescriptor::InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00115       { return mInput; }

Here is the caller graph for this function:

template<class T >
virtual bbtk::AtomicBlackBoxDescriptor::Pointer bbtk::WidgetBlackBoxDescriptor< T >::GetInstance (  )  const [inline, virtual]

Kind bbtk::BlackBoxDescriptor::GetKind (  )  const [inline, inherited]

Returns the kind of box.

Definition at line 108 of file bbtkBlackBoxDescriptor.h.

00108 { return mKind; }

std::string bbtk::Object::GetObjectInfo (  )  const [virtual, inherited]

virtual size_t bbtk::Object::GetObjectInternalSize (  )  const [inline, virtual, inherited]

template<class T >
std::string bbtk::WidgetBlackBoxDescriptor< T >::GetObjectName (  )  const [inline, virtual]

Reimplemented from bbtk::Object.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

virtual size_t bbtk::Object::GetObjectRecursiveSize (  )  const [inline, virtual, inherited]

static long bbtk::Object::GetObjectsCount (  )  [inline, static, inherited]

Definition at line 75 of file bbtkObject.h.

Referenced by bbtk::StaticInitTime::~StaticInitTime().

00075 { return mgObjectList.size(); }

Here is the caller graph for this function:

virtual size_t bbtk::Object::GetObjectSize (  )  const [inline, virtual, inherited]

const BlackBoxDescriptor::OutputDescriptor * bbtk::BlackBoxDescriptor::GetOutputDescriptor ( const std::string &  name  )  const [inherited]

Returns a const pointer on the descriptor of the output of name <name>.

Definition at line 205 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtkError, bbtk::i, and bbtk::BlackBoxDescriptor::mOutput.

00206   {
00207     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::GetOutputDescriptor('"
00208                       <<name<<"')"<<std::endl);
00209 
00210     OutputDescriptorMapType::const_iterator i;
00211     i = mOutput.find(name);
00212     if ( i == mOutput.end() ) 
00213     {
00214       bbtkError("output '"<<name<<"' does not exist");
00215     }
00216 
00217     return i->second;
00218   }

const OutputDescriptorMapType& bbtk::BlackBoxDescriptor::GetOutputDescriptorMap (  )  const [inline, inherited]

Returns a const ref on the map of output descriptors.

Definition at line 118 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::ComplexBlackBoxDescriptor::InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIBlackBoxInfo::UpdateInfo().

00119       { return mOutput; }

Here is the caller graph for this function:

PackagePointer bbtk::BlackBoxDescriptor::GetPackage (  )  const [inline, inherited]

Returns the Package to which the box belongs (const pointer).

Definition at line 105 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::GetFullTypeName(), bbtk::ComplexBlackBoxDescriptor::GetHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected().

00105 { return mPackage; }

Here is the caller graph for this function:

template<class U >
boost::shared_ptr<U> bbtk::Object::GetThisPointer (  )  const [inline, protected, inherited]

Definition at line 92 of file bbtkObject.h.

00093     {
00094       return boost::dynamic_pointer_cast<U>(mThisPointer.lock());
00095     }

const std::string& bbtk::BlackBoxDescriptor::GetTypeName (  )  const [inline, inherited]

Returns the name of the **TYPE** of the black box.

Definition at line 90 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::ComplexBlackBoxDescriptor::GetHelp(), bbtk::ComplexBlackBoxDescriptor::InsertHtmlHelp(), bbtk::BlackBoxDescriptor::InsertHtmlHelp(), and bbtk::WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected().

00090 { return mTypeName; }

Here is the caller graph for this function:

long bbtk::Object::GetUseCount (  )  [inline, inherited]

Definition at line 63 of file bbtkObject.h.

00063 { return mThisPointer.use_count(); }

void bbtk::BlackBoxDescriptor::InsertHtmlHelp ( std::ofstream &  s,
int  detail,
int  level,
const std::string &  output_dir = "",
bool  relative_link = false 
) [virtual, inherited]

Writes html formatted help into the output file stream. detail and level are used for graphical representation of complex black boxes (see ComplexBlackBox::InsertHTMLGraph) output_dir is the directory in which to write auxilliary files (.dot/.png/.cmap)

Reimplemented in bbtk::ComplexBlackBoxDescriptor.

Definition at line 312 of file bbtkBlackBoxDescriptor.cxx.

References bbtkDDebugMessage, bbtk::BlackBoxDescriptor::GetAuthor(), bbtk::BlackBoxDescriptor::GetCategory(), bbtk::BlackBoxDescriptor::GetDescription(), bbtk::BlackBoxDescriptor::GetInputDescriptorMap(), bbtk::BlackBoxDescriptor::GetOutputDescriptorMap(), bbtk::BlackBoxDescriptor::GetPackage(), bbtk::BlackBoxDescriptor::GetTypeName(), bbtk::Utilities::html_format(), and bbtk::Utilities::SplitString().

00316   {
00317     bbtkDDebugMessage("kernel",9,"BlackBoxDescriptor::InsertHtmlHelp()"
00318                       <<std::endl);
00319     
00320     //-------------
00321     // General info 
00322     std::string name = GetTypeName();
00323     Utilities::html_format(name);
00324 
00325     (s) << "<p><hr>\n";
00326     (s) << "<a name=\""<<name<<"\"></a>\n";
00327     (s) << //"Top:&nbsp;
00328       "<a rel=\"top\" accesskey=\"t\" href=\"#Top\">Top</a>\n";
00329     // (s) << "Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
00330     // (s) << "Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
00331     (s) << "<h2 class=\"section\">"<<name<<"</h2>\n";
00332 
00333 
00334     std::string descr = GetDescription();
00335     //Utilities::html_format(descr);
00336     std::string author = GetAuthor();
00337     Utilities::html_format(author);
00338 
00339     std::vector<std::string> categories;
00340     // Split the category string 
00341     std::string delimiters = ";,";
00342     Utilities::SplitString(GetCategory(),
00343                            delimiters,categories);
00344 
00345     
00346     (s) << "<p><TABLE cellspacing=0  cellpadding=3>\n";
00347     (s) << "<TR><TD style='vertical-align: top;'><b> Description </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'> " 
00348       << descr << "</TD></TR>\n";
00349     (s) << "<TR><TD style='vertical-align: top;'><b> Author(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  " 
00350       << author << "</TD></TR>\n";
00351     (s) << "<TR><TD style='vertical-align: top;'><b> Category(s) </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  ";
00352     std::vector<std::string>::iterator ci;
00353     for (ci=categories.begin(); ci!=categories.end(); ++ci)
00354       {
00355         s << "<a href=\"../index-category.html#"<< *ci <<"\">" << *ci 
00356           << "</a>&nbsp;\n";
00357       }
00358     s << "</TD></TR>\n";      
00359 
00360     (s) << "<TR><TD style='vertical-align: top;'><b> To use it </b></TD><TD style='vertical-align: top;'> : </TD><TD style='vertical-align: top;'>  include " 
00361         << GetPackage()->GetName() << "</TD></TR>\n";
00362     (s) << "</TABLE>\n";
00363 
00364     //-------------
00365     // Graph
00366     //i->second->InsertHTMLGraph( &s , detail,level,dir);
00367     
00368     //-------------
00369     // Inputs
00370     std::string titlecol("#BBBBFF");
00371     std::string usercol("#FFFFFF");
00372     std::string ubbcol("#DDFFFF");
00373     std::string wxbbcol("#EEFFFF");
00374 
00375 
00376     //  (s) << "<h3 class=\"subsection\">Inputs</h3>\n";
00377     (s) << "<p><TABLE border=1 cellspacing=0 cellpadding=3>\n";
00378     (s) << "<TR><TD colspan=3 align=center bgcolor=\""<<titlecol
00379       <<"\">Inputs</TD></TR>\n";
00380 
00381     std::vector<std::string> user_defined;
00382     std::vector<std::string> ubb_defined;
00383     std::vector<std::string> wxbb_defined;
00384 
00385     const BlackBoxDescriptor::InputDescriptorMapType& imap = 
00386       GetInputDescriptorMap();
00387     InputDescriptorMapType::const_iterator in;
00388     for ( in = imap.begin();  in != imap.end(); ++in ) 
00389     {
00390       // Skips system-defined inputs
00391       std::string col(usercol);
00392       int iotype = 0;
00393       if (in->second->GetCreatorTypeInfo() == 
00394           typeid(AtomicBlackBoxDescriptor))
00395         {
00396           col = ubbcol; 
00397           iotype = 1;
00398         }
00399 #ifdef USE_WXWIDGETS
00400       else if (in->second->GetCreatorTypeInfo() == 
00401                typeid(WxBlackBoxDescriptor))
00402         {
00403           col = wxbbcol; 
00404           iotype = 2;
00405         }
00406 #endif
00407 
00408       std::string name(in->second->GetName());
00409       Utilities::html_format(name);
00410       
00411       std::string type("<");
00412       type += in->second->GetTypeName();    
00413       type += ">";
00414       Utilities::html_format(type);
00415       
00416       std::string descr(in->second->GetDescription());
00417       //Utilities::html_format(descr);
00418 
00419 /*EED 10/11/2009
00420       std::string out = 
00421         "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
00422         +"\"><B><PRE> "+name+" </PRE></B></TD>"
00423         + "<TD style='vertical-align: top;' bgcolor=\""+col
00424         +"\"><I><PRE> "+type+" </PRE></I></TD>"
00425         + "<TD style='vertical-align: top;' bgcolor=\""+col
00426         +"\">"+descr+"</TD></TR>\n";
00427 */      
00428 
00429       std::string out = 
00430         "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
00431         +"\"><B><PRE> "+name+" </PRE></B></TD>"
00432         + "<TD style='vertical-align: top;' bgcolor=\""+col
00433         +"\"><I><PRE> "+descr+" </PRE></I></TD>"
00434         + "<TD style='vertical-align: top;' bgcolor=\""+col
00435         +"\">"+type+"</TD></TR>\n";
00436 
00437       if (iotype==0) user_defined.push_back(out);
00438       else if (iotype==1) ubb_defined.push_back(out);
00439       else if (iotype==2) wxbb_defined.push_back(out);
00440       
00441     }
00442 
00443     std::vector<std::string>::iterator hi;
00444     for (hi=user_defined.begin();hi!=user_defined.end();++hi) s << *hi;
00445     for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) s << *hi;
00446     for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) s << *hi;
00447 
00448     user_defined.clear();
00449     ubb_defined.clear();
00450     wxbb_defined.clear();
00451 
00452     //-------------
00453     // Outputs
00454     //  (s) << "<h3 class=\"subsection\">Outputs</h3>\n";
00455     //  (s) << "<TABLE border=1 cellspacing=0>\n";
00456     (s) << "<TR><TD colspan=3 align=center bgcolor=\""<<titlecol
00457       <<"\">Outputs</TD></TR>\n";
00458     
00459     const BlackBoxDescriptor::OutputDescriptorMapType& omap = 
00460       GetOutputDescriptorMap();
00461     
00462     BlackBoxDescriptor::OutputDescriptorMapType::const_iterator o;
00463     
00464     for ( o = omap.begin();  o != omap.end(); ++o ) 
00465       {
00466         std::string col(usercol);
00467         int iotype = 0;
00468         if (o->second->GetCreatorTypeInfo() == 
00469             typeid(AtomicBlackBoxDescriptor))
00470           {
00471             col = ubbcol; 
00472             iotype = 1;
00473           }
00474 #ifdef USE_WXWIDGETS
00475         else if (o->second->GetCreatorTypeInfo() == 
00476                  typeid(WxBlackBoxDescriptor))
00477           {
00478             col = wxbbcol; 
00479             iotype = 2;
00480           }
00481 #endif
00482         
00483         std::string name(o->second->GetName());
00484         Utilities::html_format(name);
00485         
00486         std::string type("<");
00487         type += o->second->GetTypeName();    
00488         type += ">";
00489         Utilities::html_format(type);
00490         
00491         std::string descr(o->second->GetDescription());
00492         //Utilities::html_format(descr);
00493         
00494 /*EED 10/11/2009
00495         std::string out = 
00496           "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
00497           +"\"><B><PRE> "+name+" </PRE></B></TD>"
00498           + "<TD style='vertical-align: top;' bgcolor=\""+col
00499           +"\"><I><PRE> "+type+" </PRE></I></TD>"
00500           + "<TD style='vertical-align: top;' bgcolor=\""+col
00501           +"\">"+descr+"</TD></TR>\n";
00502 */
00503         std::string out = 
00504           "<TR><TD style='vertical-align: top;' bgcolor=\"" + col
00505           +"\"><B><PRE> "+name+" </PRE></B></TD>"
00506           + "<TD style='vertical-align: top;' bgcolor=\""+col
00507           +"\"><I><PRE> "+descr+" </PRE></I></TD>"
00508           + "<TD style='vertical-align: top;' bgcolor=\""+col
00509           +"\">"+type+"</TD></TR>\n";
00510 
00511         if (iotype==0) user_defined.push_back(out);
00512         else if (iotype==1) ubb_defined.push_back(out);
00513         else if (iotype==2) wxbb_defined.push_back(out);
00514         
00515       }
00516     
00517     for (hi=user_defined.begin();hi!=user_defined.end();++hi) s << *hi;
00518     for (hi=wxbb_defined.begin();hi!=wxbb_defined.end();++hi) s << *hi;
00519     for (hi=ubb_defined.begin();hi!=ubb_defined.end();++hi) s << *hi;
00520 
00521     (s) << "</TABLE>\n";
00522     
00523     //------------
00524     // End
00525 
00526 
00527    }

Here is the call graph for this function:

void bbtk::Object::InsertInObjectList ( Pointer  p  )  [static, inherited]

Definition at line 59 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

Referenced by bbtk::Object::MakePointer().

00060   { 
00061     bbtkDebugMessage("object",9,"##> Object::InsertInObjectList(\""
00062                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00063     boost::weak_ptr<Object> w(p);
00064     mgObjectList.insert(w); 
00065   }

Here is the caller graph for this function:

void bbtk::Object::InsertInPackageList ( Pointer  p  )  [static, inherited]

Definition at line 69 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgPackageList.

00070   { 
00071     bbtkDebugMessage("object",9,"##> Object::InsertInPackageList(\""
00072                      <<p->GetObjectName()<<"\" ["<<p<<"])"<<std::endl);
00073     boost::weak_ptr<Object> w(p);
00074     mgPackageList.insert(w); 
00075   }

template<class T >
static bbtk::AtomicBlackBoxDescriptor::Pointer bbtk::WidgetBlackBoxDescriptor< T >::Instance (  )  [inline, static]

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

void bbtk::Object::LockThis (  )  [inline, protected, inherited]

Definition at line 88 of file bbtkObject.h.

00088 { mThisPointerLocked = mThisPointer.lock(); }   

template<class U , class D >
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
const D &  del,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 115 of file bbtkObject.h.

References bbtk::Object::InsertInObjectList().

00118     {                                                                   
00119       if (s->mThisPointer.lock())                                       
00120         {                                                               
00121           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00122           if (!lock) s->mThisPointerLocked.reset();
00123           return p;
00124         }                                                               
00125       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,del);
00126       static_cast<D*>                                   
00127         (p._internal_get_deleter(typeid(D)))            
00128         ->mPointer = p;                                                 
00129       s->mThisPointer = p;                                              
00130       Object::InsertInObjectList(p);                                    
00131       if (lock) s->LockThis();                                          
00132       return p;                                                 
00133     }                                                                   

Here is the call graph for this function:

template<class U >
static boost::shared_ptr<U> bbtk::Object::MakePointer ( U *  s,
bool  lock = false 
) [inline, static, protected, inherited]

Definition at line 97 of file bbtkObject.h.

References bbtk::Object::InsertInObjectList().

Referenced by bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor(), bbtk::Executer::Executer(), bbtk::Interpreter::Init(), bbtk::Transcriptor::New(), bbtk::Package::New(), bbtk::InterpreterVirtual::New(), bbtk::Interpreter::New(), bbtk::Factory::New(), bbtk::Executer::New(), and bbtk::ComplexBlackBoxDescriptor::New().

00098     {                                                                   
00099       if (s->mThisPointer.lock())                                       
00100         {                                                               
00101           boost::shared_ptr<U> p = s->GetThisPointer<U>();
00102           if (!lock) s->mThisPointerLocked.reset();
00103           return p;
00104         }                                                               
00105       boost::shared_ptr<U> p = boost::shared_ptr<U>(s,Object::Deleter());
00106       static_cast<Object::Deleter*>                                     
00107         (p._internal_get_deleter(typeid(Object::Deleter)))              
00108         ->mPointer = p;                                                 
00109       s->mThisPointer = p;                                              
00110       Object::InsertInObjectList(p);                                    
00111       if (lock) s->LockThis();                                          
00112       return p;                                                 
00113     }                                                                   

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
static Pointer bbtk::WidgetBlackBoxDescriptor< T >::New (  )  [inline, static]

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

template<class T >
bbtk::BlackBox::Pointer bbtk::WidgetBlackBoxDescriptor< T >::NewBlackBox ( const std::string &  boxname  )  [inline, virtual]

Releases a descriptor.

Creates an instance with name boxname of the BlackBox of which this is the descriptor

Implements bbtk::BlackBoxDescriptor.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.

void bbtk::Object::PrintObjectInfo ( const Pointer o  )  [static, inherited]

Definition at line 180 of file bbtkObject.cxx.

Referenced by bbtk::Object::PrintObjectListInfo().

00181   {
00182     std::cout << "* [" << p << "] \t" 
00183               << p.use_count()-1 << " r \t"
00184               << p->GetObjectRecursiveSize() << " ("
00185               << p->GetObjectSize() << ") b \t"
00186               << p->GetObjectName() 
00187               << std::endl;
00188     std::cout << p->GetObjectInfo();
00189   }

Here is the caller graph for this function:

void bbtk::Object::PrintObjectListInfo ( const std::string &  name  )  [static, inherited]

Definition at line 105 of file bbtkObject.cxx.

References bbtk::i, bbtk::Object::mgObjectList, and bbtk::Object::PrintObjectInfo().

Referenced by bbtk::Interpreter::commandDebug().

00106   {
00107     
00108     std::cout 
00109       << "=============== Living bbtk::Object pointers ========="<<std::endl;
00110 
00111     long n = 0;
00112     long u = 0;
00113     size_t m = 0;
00114     ObjectListType::iterator i;
00115     for (i = mgObjectList.begin();
00116          i!=mgObjectList.end();
00117          ++i)
00118       {
00119         if (i->use_count() == 0) 
00120           {
00121             u++;
00122           }
00123         else 
00124           { 
00125             Object::Pointer p(i->lock());
00126             if (p->GetObjectName().find(name) != std::string::npos ) 
00127               {
00128                 std::cout << n << "/" << mgObjectList.size() << " ";
00129                 PrintObjectInfo(p);
00130                 m += p->GetObjectSize();
00131                 n++;
00132               }
00133           }
00134       }
00135     std::cout 
00136       << "------------------------------------------------------"<<std::endl; 
00137 
00138     std::cout << " Total : "<<n<<" objects - "<<m<<" b"<<std::endl;
00139     if (u==1)
00140       {
00141         std::cout<<"* Note : "<<u
00142                  <<" object in list has 0 ref count, "
00143                  <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
00144       }
00145     else if (u>1)
00146       {
00147         std::cout<<"* Note : "<<u
00148                  <<" objects in list have 0 ref count, "
00149                  <<"i.e. are no more accessible by bbtk but did not properly destroyed because another ref counting system is holding them !"<<std::endl;
00150       }
00151     std::cout
00152       << "============ EO Living bbtk::Object pointers ========="<<std::endl;
00153         
00154   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Object::ReleasePackages (  )  [static, inherited]

Definition at line 222 of file bbtkObject.cxx.

References bbtkDebugMessage, bbtk::i, bbtk::Object::mgPackageList, and bbtk::Package::Release().

Referenced by bbtk::StaticInitTime::~StaticInitTime().

00223   {
00224     bbtkDebugMessage("object",1,"##> Object::ReleasePackages()"<<std::endl);
00225     // Release package pointers
00226     ObjectListType::iterator i;
00227     for (i = mgPackageList.begin();
00228          i!= mgPackageList.end();
00229          ++i)
00230       {
00231         if (i->use_count() != 0) 
00232           { 
00233             bbtkDebugMessage("object",1,"##> Releasing package '"<<
00234                              i->lock()->GetThisPointer<Package>()->GetName()
00235                              <<"'"<<std::endl);
00236             //      Object::Pointer p(i->lock());
00237             Package::WeakPointer w(i->lock()->GetThisPointer<Package>());
00238             Package::Release(w);
00239             /*
00240             if (p->GetObjectName().find(name) != std::string::npos ) 
00241               {
00242                 std::cout << n << "/" << mgObjectList.size() << " ";
00243                 PrintObjectInfo(p);
00244                 m += p->GetObjectSize();
00245                 n++;
00246               }
00247             */
00248           }
00249       }  
00250 
00251   }

Here is the call graph for this function:

Here is the caller graph for this function:

void bbtk::Object::RemoveFromObjectList ( WeakPointer  p  )  [static, inherited]

Definition at line 80 of file bbtkObject.cxx.

References bbtkDebugMessage, and bbtk::Object::mgObjectList.

Referenced by bbtk::Object::Deleter::operator()().

00081   { 
00082     bbtkDebugMessage("object",9,"##> Object::RemoveFromObjectList()"
00083                      <<std::endl);
00084     mgObjectList.erase(p);
00085 
00086   }

Here is the caller graph for this function:

void bbtk::BlackBoxDescriptor::SetKind ( Kind  kind  )  [inline, inherited]

Sets the kind of box.

Definition at line 143 of file bbtkBlackBoxDescriptor.h.

00143 { mKind = kind; }

void bbtk::BlackBoxDescriptor::SetPackage ( PackagePointer  package  )  [inline, inherited]

Sets the Package to which the box belongs.

Definition at line 140 of file bbtkBlackBoxDescriptor.h.

00140 { mPackage = package; }

void bbtk::BlackBoxDescriptor::SetTypeName ( const std::string &  name  )  [inline, inherited]

Sets the name of the **TYPE** of BlackBox.

Definition at line 128 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::ComplexBlackBoxDescriptor::ComplexBlackBoxDescriptor().

00128 { mTypeName=name; }

Here is the caller graph for this function:

void bbtk::Object::UnLockThis (  )  [inline, protected, inherited]

Definition at line 89 of file bbtkObject.h.

00089 { mThisPointerLocked = Pointer(); }


Friends And Related Function Documentation

template<class T >
friend struct Object::Deleter [friend]

Reimplemented from bbtk::BlackBoxDescriptor.

Reimplemented in bbtk::QtBlackBoxDescriptor, and bbtk::WxBlackBoxDescriptor.

Definition at line 200 of file bbtkWidgetBlackBox.h.


Member Data Documentation

std::string bbtk::BlackBoxDescriptor::mAuthor [protected, inherited]

The author of the black box.

Definition at line 175 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToAuthor().

std::string bbtk::BlackBoxDescriptor::mCategory [protected, inherited]

The category of the black box.

Definition at line 177 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToCategory().

std::string bbtk::BlackBoxDescriptor::mDescription [protected, inherited]

The description of the black box.

Definition at line 173 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::AddToDescription().

Kind bbtk::BlackBoxDescriptor::mKind [protected, inherited]

The kind of box (standard / adaptor).

Definition at line 179 of file bbtkBlackBoxDescriptor.h.

The Package to which the box belongs.

Definition at line 181 of file bbtkBlackBoxDescriptor.h.

std::string bbtk::BlackBoxDescriptor::mTypeName [protected, inherited]

The name of the type of black box.

Definition at line 171 of file bbtkBlackBoxDescriptor.h.

Referenced by bbtk::BlackBoxDescriptor::GetFullTypeName().


The documentation for this class was generated from the following file:

Generated on Thu May 31 14:15:11 2012 for BBTK by  doxygen 1.5.7.1