Example #1
0
void generateBody( const BasicBlock * const p )
{
	if ( p != 0 ) {						
		p -> print( );
	        cout << endl;
		generateBody( p -> getNTakenPtr( ) );
		generateBody( p -> getTakenPtr( ) );
	}
}
BaseMessage* SuiColorBoxImplementation::generateMessage() {
	SuiCreatePageMessage* message = new SuiCreatePageMessage(boxID, "Script.ColorPicker");

	// Headers.
	addHeader("ColorPicker", "SelectedIndex");
	addHeader("bg.caption.lblTitle", "Text");

	StringBuffer id;
	id << usingObject.get()->getObjectID();

	//Set Body Options:
	addSetting("3", "bg.caption.lblTitle", "Text", "@base_player:swg");
	addSetting("3", "ColorPicker", "TargetRangeMax", "500");
	addSetting("3", "ColorPicker", "TargetNetworkId", id.toString().toCharArray());
	addSetting("3", "ColorPicker", "TargetVariable", variable.toCharArray());

	setHandlerText("handleColorizeFrame");

	//Generate Packet:
	generateHeader(message);
	generateBody(message);
	generateFooter(message);
	hasGenerated = true;

	return message;
}
Example #3
0
void ManGenerator::generateClassLikeNode( const InnerNode *classe,
				      CodeMarker *marker )
{
    generateHeader( classe->name() );
    out() << ".SH NAME\n"
	  << classe->name() << "\n"
          << ".SH SYNOPSYS\n";
    generateBody( classe, marker );
    generateFooter();
}
Example #4
0
/*  generate function represented by curBlockTab  */
void generateFunction( const BlockTab &curBlockTab )
{
	/* generate function parameter list */
	const ActRecord &rec = curFuncTab[ curBlockTab.funcName ];
	cout << rec.generateFuncDefn( );
	cout << "{";
	cout << rec.generateLocalDecls( ) << "\n\n";
	generateBody( curBlockTab[ 1 ] );
/*  generate the return statement  */
	cout << "\n\nreturn " << rec.getRetValue( ) << ';' << endl;
	cout << "}\n\n";
}
Example #5
0
void ManGenerator::generateFakeNode( const FakeNode *fake, CodeMarker *marker )
{
    generateHeader( "foo" );
    generateBody( fake, marker );
    generateFooter();
}
void fakeMockCodec(MockHTTPCodec& codec) {
  // For each generate* function, write some data to the chain
  EXPECT_CALL(codec, generateHeader(_, _, _, _, _))
      .WillRepeatedly(Invoke(
          [](folly::IOBufQueue& writeBuf,
             HTTPCodec::StreamID /*stream*/,
             const HTTPMessage& /*msg*/,
             bool /*eom*/,
             HTTPHeaderSize* /*size*/) { writeBuf.append(makeBuf(10)); }));

  EXPECT_CALL(codec, generatePushPromise(_, _, _, _, _, _))
      .WillRepeatedly(Invoke(
          [](folly::IOBufQueue& writeBuf,
             HTTPCodec::StreamID /*stream*/,
             const HTTPMessage& /*msg*/,
             HTTPCodec::StreamID /*assocStream*/,
             bool /*eom*/,
             HTTPHeaderSize* /*size*/) { writeBuf.append(makeBuf(10)); }));

  EXPECT_CALL(codec, generateBody(_, _, _, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                HTTPCodec::StreamID /*stream*/,
                                std::shared_ptr<folly::IOBuf> chain,
                                folly::Optional<uint8_t> /*padding*/,
                                bool /*eom*/) {
        auto len = chain->computeChainDataLength();
        writeBuf.append(chain->clone());
        return len;
      }));

  EXPECT_CALL(codec, generateChunkHeader(_, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                HTTPCodec::StreamID /*stream*/,
                                size_t length) {
        writeBuf.append(makeBuf(length));
        return length;
      }));

  EXPECT_CALL(codec, generateChunkTerminator(_, _))
      .WillRepeatedly(Invoke(
          [](folly::IOBufQueue& writeBuf, HTTPCodec::StreamID /*stream*/) {
            writeBuf.append(makeBuf(4));
            return 4;
          }));

  EXPECT_CALL(codec, generateTrailers(_, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                HTTPCodec::StreamID /*stream*/,
                                const HTTPHeaders& /*trailers*/) {
        writeBuf.append(makeBuf(30));
        return 30;
      }));

  EXPECT_CALL(codec, generateEOM(_, _))
      .WillRepeatedly(Invoke(
          [](folly::IOBufQueue& writeBuf, HTTPCodec::StreamID /*stream*/) {
            writeBuf.append(makeBuf(6));
            return 6;
          }));

  EXPECT_CALL(codec, generateRstStream(_, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                HTTPCodec::StreamID /*stream*/,
                                ErrorCode /*code*/) {
        writeBuf.append(makeBuf(6));
        return 6;
      }));

  EXPECT_CALL(codec, generateGoaway(_, _, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                uint32_t /*lastStream*/,
                                ErrorCode,
                                std::shared_ptr<folly::IOBuf>) {
        writeBuf.append(makeBuf(6));
        return 6;
      }));

  EXPECT_CALL(codec, generatePingRequest(_))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generatePingReply(_, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf, uint64_t /*id*/) {
        writeBuf.append(makeBuf(6));
        return 6;
      }));

  EXPECT_CALL(codec, generateSettings(_))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generateWindowUpdate(_, _, _))
      .WillRepeatedly(Invoke([](folly::IOBufQueue& writeBuf,
                                HTTPCodec::StreamID /*stream*/,
                                uint32_t /*delta*/) {
        writeBuf.append(makeBuf(6));
        return 6;
      }));
}
Example #7
0
void fakeMockCodec(MockHTTPCodec& codec) {
  // For each generate* function, write some data to the chain
  EXPECT_CALL(codec, generateHeader(_, _, _, _, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               const HTTPMessage& msg,
                               HTTPCodec::StreamID assocStream,
                               bool eom,
                               HTTPHeaderSize* size) {
                             writeBuf.append(makeBuf(10));
                           }));

  EXPECT_CALL(codec, generateBody(_, _, _, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               std::shared_ptr<folly::IOBuf> chain,
                               boost::optional<uint8_t> padding,
                               bool eom) {
                             auto len = chain->computeChainDataLength();
                             writeBuf.append(chain->clone());
                             return len;
                           }));

  EXPECT_CALL(codec, generateChunkHeader(_, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               size_t length) {
                             writeBuf.append(makeBuf(length));
                             return length;
                           }));

  EXPECT_CALL(codec, generateChunkTerminator(_, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream) {
                             writeBuf.append(makeBuf(4));
                             return 4;
                           }));

  EXPECT_CALL(codec, generateTrailers(_, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               const HTTPHeaders& trailers) {
                             writeBuf.append(makeBuf(30));
                             return 30;
                           }));

  EXPECT_CALL(codec, generateEOM(_, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generateRstStream(_, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               ErrorCode code) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generateGoaway(_, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               uint32_t lastStream,
                               ErrorCode code) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generatePingRequest(_))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generatePingReply(_, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               uint64_t id) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generateSettings(_))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

  EXPECT_CALL(codec, generateWindowUpdate(_, _, _))
    .WillRepeatedly(Invoke([] (folly::IOBufQueue& writeBuf,
                               HTTPCodec::StreamID stream,
                               uint32_t delta) {
                             writeBuf.append(makeBuf(6));
                             return 6;
                           }));

}
void PlatformCreator::SpawnFade(sf::Vector2f pos, sf::Vector2f fade, sf::Vector2f timing) {
	m_platforms.push_back(std::make_shared<FadePlatform>(generateBody(pos, "Fade-Platform"), fade.x, fade.y, timing.x, timing.y));
}
void PlatformCreator::SpawnFade(sf::Vector2f pos) {
	m_platforms.push_back(std::make_shared<FadePlatform>(generateBody(pos, "Fade-Platform")));
}
void PlatformCreator::SpawnOneWay(sf::Vector2f pos) {
	m_platforms.push_back(std::make_shared<OneWayPlatform>(generateBody(pos, "OneWay-Platform")));
}
void PlatformCreator::SpawnNodePlatform(sf::Vector2f pos, string id_node, bool dir) {
	m_platforms_node.push_back(std::make_shared<NodePlatform>(generateBody(pos, "Platform"), id_node, dir));
	//cLog::inst()->print(0, "PlatformCreator", "Node Platform created.");
}