Example #1
0
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("information about the URLs this server supports");
		desc.getAPI();
		desc.output("a list of URLs supported");
		desc.source(__FILE__, __LINE__);
	}
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("Manipulate a map of runtime-override options.");
		desc.getAPI();
		desc.postAPI();
		desc.source(__FILE__, __LINE__);
	}
Example #3
0
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("says hello");
		desc.getAPI();
		desc.output("\"hello\"");
		desc.source(__FILE__, __LINE__);
	}
Example #4
0
 	virtual void describe(Description& desc) const
	{
		desc.shortInfo("seed capability info for a region");
		desc.postAPI();
		desc.input(
			"{ seed-capability: ..., sim-ip: ..., sim-port }");
		desc.source(__FILE__, __LINE__);
	}
Example #5
0
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("echo input");
		desc.postAPI();
		desc.input("<any>");
		desc.output("<the input>");
		desc.source(__FILE__, __LINE__);
	}
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("Used for receiving a reply to a request to initialize an ChatterBox session");
		desc.postAPI();
		desc.input(
			"{\"client_session_id\": UUID, \"session_id\": UUID, \"success\" boolean, \"reason\": string");
		desc.source(__FILE__, __LINE__);
	}
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("Manipulate a single runtime-override option.");
		desc.getAPI();
		desc.putAPI();
		desc.delAPI();
		desc.source(__FILE__, __LINE__);
	}
	virtual void describe(Description& desc) const
	{
		desc.shortInfo("Used for receiving a reply to a ChatterBox session event");
		desc.postAPI();
		desc.input(
			"{\"event\": string, \"reason\": string, \"success\": boolean, \"session_id\": UUID");
		desc.source(__FILE__, __LINE__);
	}
Example #9
0
	std::multiset< int > relevance( Tag tag1){
				std::multiset< int > temp_multiset;
				description_itr = description.begin();
				
				for (int fi= description.size();fi>0 ;fi--, description_itr++ )
					temp_multiset.insert( ((*all_distances_ptr)[*description_itr][tag1] ));
				return temp_multiset;

			};
Example #10
0
/*! Returns the default properties of a particular input channel */
map<string, Property> InputChannelFactory::getDefaultProperties(Description& desc) {
    if(desc.getName() == "Joint Input Channel") {
        return JointInputChannel().getProperties();
    }
    else if(desc.getName() == "Visual Input Channel") {
        return VisualInputChannel().getProperties();
    }
    throw ISpikeException("Invalid input channel");
}
Example #11
0
 const std::vector<const Description*> Send::setupInputs()
 {
     std::vector<const Description*> inputs;
     Description* input = new Description(INPUT, Variant::DATA);
     input->setTitle("Input");
     inputs.push_back(input);
     
     return inputs;
 }
Example #12
0
 const std::vector<const Description*> ReadGpio::setupOutputs()
 {
     std::vector<const Description*> outputs;
     
     Description* output = new Description(OUTPUT, Variant::BOOL);
     output->setTitle("Output");
     outputs.push_back(output);
     
     return outputs;
 }
Example #13
0
 const std::vector<const Description*> ConvertPixelType::setupOutputs()
 {
     std::vector<const Description*> outputs;
     
     Description* output = new Description(OUTPUT, Variant::IMAGE);
     output->setTitle("Output");
     outputs.push_back(output);
     
     return outputs;
 }
Example #14
0
 const std::vector<const Description*> Split::setupInputs()
 {
     std::vector<const Description*> inputs;
     Description* input = new Description(INPUT, Variant::LIST);
     input->setTitle(L_("List"));
     input->setOperatorThread(LIST_THREAD);
     inputs.push_back(input);
     
     return inputs;
 }
Example #15
0
 const std::vector<const Description*> Flicker::setupOutputs()
 {
     std::vector<const Description*> outputs;
     
     Description* output = new Description(OUTPUT, Variant::IMAGE);
     output->setTitle(L_("Output"));
     outputs.push_back(output);
     
     return outputs;
 }
Example #16
0
 const std::vector<const runtime::Description*> Flicker::setupInputs()
 {
     std::vector<const Description*> inputs;
     
     Description* input = new Description(INPUT, Variant::IMAGE);
     input->setTitle(L_("Input"));
     inputs.push_back(input);
     
     return inputs;
 }
Example #17
0
 const std::vector<const Description*> Merge::setupOutputs() const
 {
     std::vector<const Description*> outputs;
     
     Description* output = new Description(OUTPUT, Variant::LIST);
     output->setTitle(L_("List"));
     output->setOperatorThread(LIST_THREAD);
     outputs.push_back(output);
     
     return outputs;
 }
Example #18
0
 const std::vector<const Description*> ExceptionOperator::setupInputs()
 {
     std::vector<const Description*> inputs;
     Description* description = 0;
     
     description = new Description(INPUT, Variant::NONE);
     description->setTitle("Input");
     inputs.push_back(description);
     
     return inputs;
 }
Example #19
0
int main()
{
	Description d;
	*(char*)&d = 0;

	char string[3];

	while (scanf (" %2s", string) == 1) {
		d.parse (string);
	}

	printf ("%hhx\n", *(char*)&d);
}
Example #20
0
	std::multiset<int > relevance( Description description2){
				std::multiset<  int > temp_multiset;
				Description::iterator description2_itr;  
				description_itr = description.begin();

				for (int fi= description.size();fi>0 ;fi--, description_itr++ )
				{
					description2_itr = description2.begin();
					for (int fj= description2.size();fj>0 ;fj--, description2_itr++ ) 
					{
						temp_multiset.insert( ((*all_distances_ptr)[*description_itr][*description2_itr] ));

					}
				}
				return temp_multiset;

			};
Example #21
0
 const std::vector<const runtime::Description*> ConvertPixelType::setupInputs()
 {
     std::vector<const Description*> inputs;
     
     Description* source = new Description(SOURCE, Variant::IMAGE);
     source->setTitle("Source");
     inputs.push_back(source);
     
     if (m_dataFlow == MANUAL)
     {
         Description* destination = new Description(DESTINATION, Variant::IMAGE);
         destination->setTitle("Destination");
         inputs.push_back(destination);
     }
     
     return inputs;
 }
Example #22
0
// This function checks if the problem parameters are correct, then tells
// Solver to solve the current problem.
void solveProblem(const Description & description,
		  const Parameters & parameters, Preferences & preferences,
		  Solver & solver) {
  
	// The problem is ready to be solved if the parameters file contains all
	// the basic parameters.
  	if (parameters.readyToSolve()) {
		// The parameters are captured and sent to Solver.
      	parameters.capture(description.getGeneralConstraintsNumber(),
			 description.getSurrogateUse(), solver);
      
	  	// The preferences are sent to Solver.
      	preferences.capture(description.getName(), solver);

      	// Data entry complete: Solver evaluates the starting point.
      	if (solver.evaluateStartingPoint() > 0) {
	  		// 'fout' is the results file for the current run.
	  		ofstream fout(description.getResultsFile());
	  		
			// The problem's input is written in 'fout'.
	  		solver.showInput(fout);
	  
			// The problem is solved by the optimization module.
	  		solver.solveProblem(fout);
	  
			// The results file is closed.
	  		fout.close();
	  
			// The 'Preferences' object must be alerted that the run is over.
	  		preferences.endOfRun();
		}
		else {
	  		cerr << "The starting point is outside the bounds!\n";
	  		cerr << "Please correct before running NOMAD.\n";
	  		cerr << "See the program documentation in the 'DOC' directory.\n\n";
		}
    }
  	else {  // We alert the user that something's wrong with the parameters.
		cerr << "Something is wrong with the parameters!\n";
		cerr << "Please correct before running NOMAD.\n";
      	cerr << "See the program documentation in the 'DOC' directory.\n\n";
    }
}
void DescriptionBuffer::copiarLectura(void *elemento, long posicion)
{
	Description *elem = (Description *) elemento;
	Description *dato = _datos[posicion];
	char* buffer = elem->getBuffer();
	dato->getBufferCopied(&buffer);
	elem->setBuffer(buffer,dato->getSize());//It is only for updating the _usedSize of the buffer
	elem->setId(dato->getId());
	return;
#ifdef _DEBUG
	 //printf("DescriptionBuffer::copiarLectura: imagen %d ; posicion %d\n",im->getId(),posicion);
#endif
}
Example #24
0
    virtual void get(ResponsePtr response, const LLSD& context) const
	{
		const LLSD& remainder = context["request"]["remainder"];
		
		if (remainder.size() > 0)
		{
			const LLHTTPNode* node = followRemainder(remainder);
			if (!node)
			{
				response->notFound();
				return;
			}
			
			Description desc;
			node->describe(desc);
			response->result(desc.getInfo());
			return;
		}

		response->result(rootNode()->allNodePaths());
	}
Example #25
0
  inline void
  print_text (std::ostream& os, Description const& d)
  {
    using std::endl;

    os << d.command ();

    Description::OptionIterator ob = d.begin_option ();
    Description::OptionIterator oe = d.end_option ();

    if (ob != oe)
    {
      os << " { OPTIONS }";
    }

    Description::ArgumentIterator ab = d.begin_argument ();
    Description::ArgumentIterator ae = d.end_argument ();

    for (; ab != ae; ab++)
    {
      os << " <" << *ab << ">";
    }

    os << endl << endl;

    for (; ob != oe; ob++)
    {
      bool flag (ob->type () == OptionType::flag);
      bool optional (ob->optional ());
      std::string prefix (ob->name ().length () == 1 ? "-" : "--");

      os << (optional ? "[" : "") << prefix << ob->name ()
         << (flag ? "" : " ") << ob->value_synopsis ()
         << (optional ? "]" : "")
         << endl;

      os << "\t\t" << ob->description () << endl << endl;
    }

  }
Example #26
0
 const std::vector<const Description*> Merge::setupInputs()
 {
     std::vector<const Description*> inputs;
     
     Description* data = new Description(INPUT_DATA, Variant::DATA);
     data->setTitle(L_("List item"));
     data->setOperatorThread(ITEM_THREAD);
     inputs.push_back(data);
     
     Description* index = new Description(INPUT_NUM_ITEMS, Variant::INT);
     index->setTitle(L_("Number of list items"));
     index->setOperatorThread(LIST_THREAD);
     inputs.push_back(index);
     
     return inputs;
 }
Example #27
0
 const std::vector<const Description*> Split::setupOutputs() const
 {
     std::vector<const Description*> outputs;
     
     Description* data = new Description(OUTPUT_DATA, Variant::DATA);
     data->setTitle(L_("List item"));
     data->setOperatorThread(ITEM_THREAD);
     outputs.push_back(data);
     
     Description* index = new Description(OUTPUT_NUM_ITEMS, Variant::UINT_64);
     index->setTitle(L_("Number of list items"));
     index->setOperatorThread(LIST_THREAD);
     outputs.push_back(index);
     
     return outputs;
 }
Example #28
0
int main (int argc, char* argv[])
{

	/****************************************************************
	 1 - process command line
	*****************************************************************/

	process_cmdline(argc, argv);

	if (gHelpSwitch) 		{ printhelp(); exit(0); }
	if (gVersionSwitch) 	{ printversion(); exit(0); }

    initFaustDirectories();
    alarm(gTimeout);


	/****************************************************************
	 2 - parse source files
	*****************************************************************/

	startTiming("parser");

	list<string>::iterator s;
	gResult2 = nil;
	yyerr = 0;

	if (gInputFiles.begin() == gInputFiles.end()) {
		exit(1);
	}
	for (s = gInputFiles.begin(); s != gInputFiles.end(); s++) {
		if (s == gInputFiles.begin()) {
            gMasterDocument = *s;
        }
		gResult2 = cons(importFile(tree(s->c_str())), gResult2);
	}
	if (yyerr > 0) {
		cerr << "ERROR : paorsing count = " <<  yyerr << endl;
		exit(1);
	}
	gExpandedDefList = gReader.expandlist(gResult2);

	endTiming("parser");
	
	/****************************************************************
	 3 - evaluate 'process' definition
	*****************************************************************/
	
	startTiming("evaluation");


    Tree process = evalprocess(gExpandedDefList);

	if (gErrorCount > 0) {
       // cerr << "Total of " << gErrorCount << " errors during evaluation of : process = " << boxpp(process) << ";\n";
        cerr << "Total of " << gErrorCount << " errors during the compilation of  " << gMasterDocument << ";\n";
		exit(1);
	}


	if (gDetailsSwitch) { cerr << "process = " << boxpp(process) << ";\n"; }

	if (gDrawPSSwitch || gDrawSVGSwitch) {
		string projname = makeDrawPathNoExt();
     	if (gDrawPSSwitch) 	{ drawSchema( process, subst("$0-ps", projname).c_str(), "ps" ); }
		if (gDrawSVGSwitch) { drawSchema( process, subst("$0-svg", projname).c_str(), "svg" ); }
	}

	int numInputs, numOutputs;
	if (!getBoxType(process, &numInputs, &numOutputs)) {
		cerr << "ERROR during the evaluation of  process : "
			 << boxpp(process) << endl;
		exit(1);
	}

	if (gDetailsSwitch) {
        cerr <<"process has " << numInputs <<" inputs, and " << numOutputs <<" outputs" << endl;
    }
	
	endTiming("evaluation");
    
    if (gExportDSP) {
        ofstream xout(subst("$0_exp.dsp", makeDrawPathNoExt()).c_str());
        xout << "process = " << boxpp(process) << ";" << endl;
        return 0;
    }
 
	/****************************************************************
	 3.5 - output file list is needed
	*****************************************************************/
	if (gPrintFileListSwitch) {
		cout << "******* ";
		// print the pathnames of the files used to evaluate process
		vector<string> pathnames = gReader.listSrcFiles();
		for (unsigned int i=0; i< pathnames.size(); i++) cout << pathnames[i] << ' ';
		cout << endl;

	}
	

	/****************************************************************
	 4 - compute output signals of 'process'
	*****************************************************************/
	
	startTiming("propagation");


	Tree lsignals = boxPropagateSig(nil, process , makeSigInputList(numInputs) );
	if (gDetailsSwitch) { cerr << "output signals are : " << endl;  printSignal(lsignals, stderr); }

	endTiming("propagation");


	/****************************************************************
	 5 - translate output signals into C++ code
	*****************************************************************/

	startTiming("compilation");

	Compiler* C;
	if (gSchedulerSwitch)   C = new SchedulerCompiler(gClassName, "dsp", numInputs, numOutputs);
	else if (gVectorSwitch) C = new VectorCompiler(gClassName, "dsp", numInputs, numOutputs);
	else                    C = new ScalarCompiler(gClassName, "dsp", numInputs, numOutputs);

	if (gPrintXMLSwitch) C->setDescription(new Description());
	if (gPrintDocSwitch) C->setDescription(new Description());

	C->compileMultiSignal(lsignals);

	endTiming("compilation");

	/****************************************************************
	 6 - generate XML description (if required)
	*****************************************************************/

	if (gPrintXMLSwitch) {
		Description* 	D = C->getDescription(); assert(D);
		ofstream 		xout(subst("$0.xml", makeDrawPath()).c_str());

        if(gMetaDataSet.count(tree("name"))>0)          D->name(tree2str(*(gMetaDataSet[tree("name")].begin())));
        if(gMetaDataSet.count(tree("author"))>0)        D->author(tree2str(*(gMetaDataSet[tree("author")].begin())));
        if(gMetaDataSet.count(tree("copyright"))>0)     D->copyright(tree2str(*(gMetaDataSet[tree("copyright")].begin())));
        if(gMetaDataSet.count(tree("license"))>0)       D->license(tree2str(*(gMetaDataSet[tree("license")].begin())));
        if(gMetaDataSet.count(tree("version"))>0)       D->version(tree2str(*(gMetaDataSet[tree("version")].begin())));

		D->className(gClassName);
		D->inputs(C->getClass()->inputs());
		D->outputs(C->getClass()->outputs());

		D->print(0, xout);
	}


	/****************************************************************
	 7 - generate documentation from Faust comments (if required)
	*****************************************************************/


	if (gPrintDocSwitch) {
		if (gLatexDocSwitch) {
            printDoc(subst("$0-mdoc", makeDrawPathNoExt()).c_str(), "tex", FAUSTVERSION);
		}
	}




	/****************************************************************
	 8 - generate output file
	*****************************************************************/

	ostream* dst;
	istream* enrobage;
	//istream* intrinsic;

	if (gOutputFile != "") {
        string outpath = (gOutputDir != "") ? (gOutputDir + "/" + gOutputFile) : gOutputFile;
		dst = new ofstream(outpath.c_str());
	} else {
		dst = &cout;
	}

	if (gArchFile != "") {
		if ( (enrobage = open_arch_stream(gArchFile.c_str())) ) {
            printheader(*dst);
			C->getClass()->printLibrary(*dst);
			C->getClass()->printIncludeFile(*dst);
            C->getClass()->printAdditionalCode(*dst);

            streamCopyUntil(*enrobage, *dst, "<<includeIntrinsic>>");

// 			if ( gVectorSwitch && (intrinsic = open_arch_stream("intrinsic.hh")) ) {
// 				streamCopyUntilEnd(*intrinsic, *dst);
// 			}
            
            if (gSchedulerSwitch) {
                istream* scheduler_include = open_arch_stream("scheduler.cpp");
                if (scheduler_include) {
                    streamCopy(*scheduler_include, *dst);
                } else {
					cerr << "ERROR : can't include \"scheduler.cpp\", file not found" << endl;
					exit(1);
				}
            }
            
			streamCopyUntil(*enrobage, *dst, "<<includeclass>>");
            printfloatdef(*dst);
            
			C->getClass()->println(0,*dst);
			streamCopyUntilEnd(*enrobage, *dst);
		} else {
			cerr << "ERROR : can't open architecture file " << gArchFile << endl;
			return 1;
		}
	} else {
        printheader(*dst);
        printfloatdef(*dst);
		C->getClass()->printLibrary(*dst);
        C->getClass()->printIncludeFile(*dst);
        C->getClass()->printAdditionalCode(*dst);
        C->getClass()->println(0,*dst);
	}


    /****************************************************************
     9 - generate the task graph file in dot format
    *****************************************************************/

    if (gGraphSwitch) {
        ofstream dotfile(subst("$0.dot", makeDrawPath()).c_str());
        C->getClass()->printGraphDotFormat(dotfile);
    }
	
	delete C;
	return 0;
}
Example #29
0
DescriptionPaint::DescriptionPaint( WBRWindow * prnt, const WRect & r,
                                    Symbol * sym )
                    : _parent( prnt )
                    , _rect( r )
                    , _current( -1 )
//--------------------------------------------------------------------
{
    int             i;
    WVList          desc;
    Description *   entry;
    WString         buf;
    const char *    uDefSymName;
    int             x = r.x();
    int             w;
    int             h;

    _parts = new WCPtrOrderedVector<DescriptionPart>;

    sym->description( desc );

    for( i = 0; i < desc.count(); i += 1 ) {
        entry = (Description *) desc[i];
        if( entry->symbol() ) {
            if( sym->isEqual( entry->symbol() ) ) {

                // don't hilight the symbol we're describing
                buf.concat( entry->name() );
                delete entry->symbol();

            } else {

                if( buf != "" ) { // flush buf
                    w = prnt->getTextExtentX( buf );
                    h = prnt->getTextExtentY( buf );
                    _parts->append( new DescriptionPart( buf.gets(), NULL,
                                        WRect(x,r.y(),w, h ) ) );

                    buf="";
                    x+=w;
                }

                uDefSymName = entry->name();
                w = prnt->getTextExtentX( uDefSymName );
                h = prnt->getTextExtentY( uDefSymName );
                _parts->append( new DescriptionPart( uDefSymName,
                                                     entry->symbol(),
                                                     WRect(x,r.y(),w, h ) ) );
                x+=w;
            }
        } else {
            buf.concat( entry->name() );
        }
    }

    desc.deleteContents();


    if( buf != "" ) { // flush buf
        w = prnt->getTextExtentX( buf );
        h = prnt->getTextExtentY( buf );
        _parts->append( new DescriptionPart( buf, NULL,
                                WRect(x,r.y(),w, h ) ) );

        buf="";
        x+=w;
    }

    _rect.w( x - abs( _rect.x() ) );
}
Example #30
0
void LLHTTPNode::describe(Description& desc) const
{
	desc.shortInfo("unknown service (missing describe() method)");
}