Ejemplo n.º 1
0
			virtual libmaus2::aio::InputStream::shared_ptr_type constructShared(std::string const & filename)
			{
				if ( filename == "-" )
				{				
					libmaus2::util::shared_ptr<std::istream>::type iptr(new PosixFdInputStream(STDIN_FILENO));
					libmaus2::aio::InputStream::shared_ptr_type istr(new libmaus2::aio::InputStream(iptr));
					return istr;
				}
				else
				{
					libmaus2::util::shared_ptr<std::istream>::type iptr(new PosixFdInputStream(filename));
					libmaus2::aio::InputStream::shared_ptr_type istr(new libmaus2::aio::InputStream(iptr));
					return istr;
				}
			}
		util::ParametersMap ServiceInformationsFunction::run(
			std::ostream& stream,
			const Request& request
		) const {

			AccessParameters ap;
			ServicePointer ptr(_service->getDeparturePosition(true, ap, _date));

			if(_stopPage.get())
			{
				_displayStop(stream, true, ptr, request);
			}
			else
			{
				_displaySIRI(stream);
			}

			for(const Edge* edge(ptr.getDepartureEdge()->getFollowingArrivalForFineSteppingOnly());
				edge;
				edge = edge->getFollowingArrivalForFineSteppingOnly()
			){
				ServicePointer iptr(ptr);
				_service->completeServicePointer(iptr, *edge, ap);
				if(_stopPage.get())
				{
					_displayStop(stream, false, iptr, request);
				}
				else
				{
					_displaySIRI(stream);
				}
			}

			return util::ParametersMap();
		}
			virtual libmaus2::aio::InputOutputStream::shared_ptr_type constructShared(std::string const & filename, std::ios_base::openmode mode)
			{
				libmaus2::util::shared_ptr<std::iostream>::type iptr(new PosixFdInputOutputStream(filename,mode));
				libmaus2::aio::InputOutputStream::shared_ptr_type istr(new libmaus2::aio::InputOutputStream(iptr));
				return istr;
			}
			virtual libmaus2::aio::InputOutputStream::unique_ptr_type constructUnique(std::string const & filename, std::ios_base::openmode mode)
			{
				libmaus2::util::shared_ptr<std::iostream>::type iptr(new PosixFdInputOutputStream(filename,mode));
				libmaus2::aio::InputOutputStream::unique_ptr_type istr(new libmaus2::aio::InputOutputStream(iptr));
				return UNIQUE_PTR_MOVE(istr);
			}