view src/parallel_execution/examples/generics_hello/StringImpl.cbc @ 1026:a48a77a88b4e

tweak
author ichikitakahiro <e165713@ie.u-ryukyu.ac.jp>
date Thu, 31 Mar 2022 13:59:06 +0900
parents
children
line wrap: on
line source

#include "../../../context.h"
#interface "String.h"
#impl "String.h" as "StringImpl.h"
#include <stdio.h>

// ----
// typedef struct StringImpl <T> impl String {
//   __code next(...);
// } StringImpl;
// ----

String<T> *createStringImpl(struct Context* context, T str) {
    struct String<T>* gHello  = new String();
    struct StringImpl<T>* string_impl = new StringImpl();
    gHello->gHello = (union Data*)string_impl;
    gHello->str = str;
    gHello->setString = C_setStringStringImpl;
    return gHello;
}
__code setString(struct StringImpl* gHello, T str, __code next(...)) {
    goto next(...);
}